Bug 72828 - pdfunite: fonts lost when merging some PDF files
Summary: pdfunite: fonts lost when merging some PDF files
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 10:06 UTC by oss+freedesktop
Modified: 2013-12-20 19:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Example input file 1 (12.74 KB, application/pdf)
2013-12-18 10:07 UTC, oss+freedesktop
Details
Example input file 2 (43.17 KB, text/plain)
2013-12-18 10:07 UTC, oss+freedesktop
Details
Output by poppler 0.24.4 (4.42 KB, application/pdf)
2013-12-18 10:08 UTC, oss+freedesktop
Details
Copy resources from Pages dict (1.38 KB, patch)
2013-12-18 15:37 UTC, Thomas Freitag
Details | Splinter Review
correct patch for resources (881 bytes, patch)
2013-12-20 11:59 UTC, Thomas Freitag
Details | Splinter Review

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.