sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.39k stars 1.7k forks source link

mpdf (php library) generated pdf with bookmarks are not seen in Sumatra but are in Adobe Reader #3780

Closed AntonioCS closed 11 months ago

AntonioCS commented 11 months ago

Hey,

I've been testing some pdf generating libs in PHP and found mpdf. This library easily generates pdfs from html and can also generate some bookmarks. I have attached a file which was generated using mpdf and unfortunately on Sumatra I don't see any bookmarks. output.pdf

Here is is on Sumatra: image And here it is on Adobe Acrobat: image

Is there special care that needs to be taken when generating bookmarks for Sumatra? Here is some more information on the features I'm using from mpdf to generate the bookmarks: https://mpdf.github.io/reference/html-control-tags/bookmark.html

kjk commented 11 months ago

I can see bookmarks in this file. Make sure to show bookmarks tree view (F12, View / Show Bookmarks, or Ctrl-K and Toggle bookmarks command).

AntonioCS commented 11 months ago

Ok... this is very strange then. In other pdfs I never have to press anything to view the bookmarks. Is this because it only has one page? But you are right, I can see it when I press F12. Thanks

GitHubRulesOK commented 11 months ago

@AntonioCS

SumatraPDF has a setting for showing bookmarks on opening (Edge will usually default to ON) image

AntonioCS commented 11 months ago

@GitHubRulesOK That is what I have in my options. As mentioned, I see other PDFs bookmarks automatically, that was I was surpriesed I had to press F12 on my little test PDF to get it showing. Possibly the issue here is that this test PDF only has one page and that might be affecting something.

GitHubRulesOK commented 11 months ago

@AntonioCS I used latest pre-release (thus "works for me"), since only there can there be any "fix" it is possible either a bad settings file or an older version may have issues with the way the bookmarks are flagged?

AntonioCS commented 11 months ago

Possibly but again, never had any issue with other PDFs. Thanks for the suggestion

kjk commented 11 months ago

This setting is also remember for each file. You must have hidden bookmarks for that file in the past.

AntonioCS commented 11 months ago

@kjk the file was generated by the php library. How does Sumatra remember the setting? By filename or full path?

kjk commented 11 months ago

we remember the full path but we also match by file name for cases of moved files. I think.