-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combination of Documents with embedded fonts #32
Comments
Thank you for submitting this issue and helping improve the CombinePDF library. I would really love to help you with this one, and I'd be thankful for any information you could provide to help me locate and resolve the issue. I would love it if you could post some sample code and maybe a two demo files that will allow me to reproduce the issue on my machine. I'm assuming you're using the the latest Also, I know that merging some PDF files might cause conflicts with named resources (i.e. fonts). For this reason, pages have a "safe" I'm wondering if you're stumping the original page object and whether you tried making a "safe" copy for the stamp (if you're using the Any information will help, |
Thx for your quick response, I can reproduce the problem with these files:
I the footer you should be able to see the missing 'L' and 'f' and 'I' characters. Dropbox links for the pdf, because github doest let me upload these to repos I dont have write access to. https://www.dropbox.com/s/8qj0s9w4v3stzfv/background.pdf |
Thank you for the code and example files. Hmmm.... just a few thoughts:
I tried using a safe copy : fg = CombinePDF.load("foreground.pdf");
fg.pages[0] << CombinePDF.load("background.pdf").pages[0].copy(true);
fg.save 'combined.pdf' This confirmed my suspicion, since (on my machine) using a safe provided me with the expected results. I'm not closing this issue since I'm not sure if the fact that the current API shouldn't be made clearer. I'm reluctant to enforce the safe copy flag as the default, since it's very intrusive, but perhaps there should be a way to automatically identify conflicts rather than have the developers (who shouldn't be expected know anything about the PDF file structure) deal with these questions...? On the other hand, this might impact performance when looping over a longer document, causing the tests to be performed so many times (resource names are page specific). |
Using I cannot judge how big the impact of make safe copy the default would be, since I don't know about the PDF spec. Maybe a short mention of this in the README is enough to point the people into the right direction, since it's really hard to tell where to look when this occurs. |
Okay, I automated the process. CombinePDF will now review the data and automatically attempt to detect conflicts. This means that even without using the Thank you for pushing me to do this 👍🏻👍🏻👍🏻 |
Resolved in version 0.2.8 |
We combine a background document with a letter - This document contains text in an embedded font. By it's own it looks just fine - after the merge single characters are missing and replaced by a box.
The text was updated successfully, but these errors were encountered: