Bug 72828

Summary: pdfunite: fonts lost when merging some PDF files
Product: poppler Reporter: oss+freedesktop
Component: utilsAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: oss+freedesktop
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Example input file 1
Example input file 2
Output by poppler 0.24.4
Copy resources from Pages dict
correct patch for resources

Description oss+freedesktop 2013-12-18 10:06:13 UTC
When merging specific PDF files, the embedded fonts don't seem to be included in the output.

I have encountered this issue specifically with PDF files generated with dompdf. I will attach two example files and the resulting output.

I can reproduce this issue with poppler 0.24.4 from Arch and 0.18.4 from Debian Wheezy.
Comment 1 oss+freedesktop 2013-12-18 10:07:29 UTC
Created attachment 90914 [details]
Example input file 1
Comment 2 oss+freedesktop 2013-12-18 10:07:53 UTC
Created attachment 90915 [details]
Example input file 2
Comment 3 oss+freedesktop 2013-12-18 10:08:23 UTC
Created attachment 90916 [details]
Output by poppler 0.24.4
Comment 4 Thomas Freitag 2013-12-18 15:37:53 UTC
Created attachment 90933 [details] [review]
Copy resources from Pages dict

The fonts were included, but there are no resources reference for the pages, because dompdf specifies the resources in the pages dict, not in the page dict itself.
The attached patch copies the resources dict from pages to every page and solves this bug, BUT: please do not commit the patch: I fear I have to merge the resources, So this is more or less a test case, not a solution!
Comment 5 oss+freedesktop 2013-12-18 16:28:50 UTC
I have applied the patch and I can confirm this solves the issue. I hope a definitive patch will be merged soon.

Thank you, Thomas!
Comment 6 Thomas Freitag 2013-12-20 11:59:18 UTC
Created attachment 91036 [details] [review]
correct patch for resources

It was much easier to create a correct patch for this problem than I thought: poppler has already the necessary methods, we just need to use them. So this new patch can be commited,
Comment 7 Albert Astals Cid 2013-12-20 19:26:02 UTC
Pushed to master, will be part of 0.25.1

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.