#1 2024-05-13 14:04:10

jonjbar
Member
Registered: 2012-12-27
Posts: 38

Support for named destinations

Hi,

Named destination are useful in PDF documents as they act as bookmarks to access a specific part of the document (e.g. https://site.com/document.pdf#destination)
See: https://evermap.com/Tutorial_ABM_Destinations.asp

I see that SynPDF supports the TPdfDestination object which works fine from hyperlinks, but it looks like this doesn't create any entries in the Acrobat's "Destinations" pane. I suspect that it isn't supported ? Or perhaps I'm missing some kind of options to export them as named destinations ?

Thanks for your help.

Offline

#2 2024-05-13 15:01:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,778
Website

Re: Support for named destinations

Did you try with mORMot 2?

Offline

#3 2024-05-14 09:16:15

jonjbar
Member
Registered: 2012-12-27
Posts: 38

Re: Support for named destinations

Yes, absolutely.

Offline

#4 2025-01-10 17:15:01

jonjbar
Member
Registered: 2012-12-27
Posts: 38

Re: Support for named destinations

I'm not sure that this feature is part of SynPDF 2. Here is a very simple PDF with a named destination, which can be opened at that specific location using the following command line: "C:\Program Files (x86)\Adobe\Acrobat Reader\Reader\AcroRd32.exe" /A "nameddest=MyDest" "C:\Documents\example.pdf"

%PDF-1.4
1 0 obj
<< /Type /Catalog /Pages 2 0 R /Names << /Dests 5 0 R >> >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 6 0 R >> >> >>
endobj
4 0 obj
<< /Length 43 >>
stream
BT /F1 24 Tf 100 700 Td (Hello, Named Destinations!) Tj ET
endstream
endobj
5 0 obj
<< /Names [(MyDest) 7 0 R] >>
endobj
6 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
7 0 obj
<< /D [3 0 R /XYZ 90 720 2] >>
endobj
xref
0 8
0000000000 65535 f
0000000010 00000 n
0000000078 00000 n
0000000123 00000 n
0000000208 00000 n
0000000270 00000 n
0000000320 00000 n
0000000377 00000 n
trailer
<< /Root 1 0 R /Size 8 >>
startxref
432
%%EOF

and for comparison the same one without any named destinations:

%PDF-1.4
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>
endobj
4 0 obj
<< /Length 35 >>
stream
BT /F1 24 Tf 100 700 Td (Hello, World!) Tj ET
endstream
endobj
5 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
xref
0 6
0000000000 65535 f
0000000010 00000 n
0000000058 00000 n
0000000103 00000 n
0000000189 00000 n
0000000245 00000 n
trailer
<< /Root 1 0 R /Size 6 >>
startxref
299
%%EOF

Here is a comparison between both PDF files:

u9Cqzq3.png

Offline

Board footer

Powered by FluxBB