Outline destination not conforming PDF spec #3275

Open
torakiki opened this Issue Jan 8, 2017 · 10 comments

Projects

None yet

3 participants

@torakiki
torakiki commented Jan 8, 2017

This is an page destination created by wkhtmltopdf

10 0 obj  
[0 /XYZ 33  
813.500000  0]     
endobj

This is not conforming the PDF spec where the first item is not a page number but

page is an indirect reference to a page object.

so the previous example should be something like

10 0 obj   
[22 0 R /XYZ 33  
813.500000  0]   
endobj
@ashkulz
Member
ashkulz commented Jan 9, 2017

@torakiki: can you post a sample HTML which generates incorrect PDF output and the correct PDF using some PDF editing tool, so that I can understand what changes need to be made?

@ashkulz ashkulz added the NeedInfo label Jan 9, 2017
@torakiki
torakiki commented Jan 9, 2017

This is the html file I used (renamed to txt to allow GitHub upload) test.txt. You can open the resulting PDF with a text editor and you can see page destinations are written as I mentioned before, the first element of the destination array is the page number but it should be the page reference so instead of 0 you should have 5 0 R if 5 is the object number of the first page object.

@ashkulz ashkulz added NeedToVerify and removed NeedInfo labels Jan 9, 2017
@ashkulz
Member
ashkulz commented Jan 10, 2017

@torakiki: would help if you uploaded screen shots, as that would save time for me 😄

@torakiki

@ashkulz of what?

@ashkulz
Member
ashkulz commented Jan 10, 2017

PDF Editor where it shows what is wrong and what has to be corrected...

@torakiki

There is no error message or screen to show. Most PDF Editor or Readers are smart enough to workaround this on the fly so the user won't notice any error message, nevertheless the generated PDF is not conforming the specs so, even though it's probably low prio, it should probably be fixed.
In my case I found the issue because our PDF library was going through the fallback branch of execution, the one where we apply the workaround.

@ashkulz
Member
ashkulz commented Jan 10, 2017

Okay, so this is more of a PDF validation issue, I thought it was not working at all.

@ashkulz
Member
ashkulz commented Jan 10, 2017

What platform do you generally test this library? In case I make a patch, would you be able to check/verify the fix?

@torakiki

@ashkulz I'm on Linux and sure, I can test the fix

@kkthek
kkthek commented Jan 12, 2017

@ashkulz: It is more than a validation issue because it causes PDFs to be merged without preserving the bookmarks. I'm am very interested in a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment