I'm using wonderful pdftocairo on my printserver for PDF to PS level3 conversion, and from time to time I stumble upon PDFs that come with non-embedded Type 1 fonts. $ pdffonts my.pdf name type encoding emb sub uni object ID ------------------------------------ ----------------- ---------------- --- --- --- --------- Helvetica Type 1 WinAnsi no no no 17 0 Helvetica-Bold Type 1 WinAnsi no no no 18 0 pdftops embeds fonts on the fly, but has an option to pass font data as is. pdftocairo doesn't embed fonts into PS, and doesn't have any relevant options. I know can manually do something like pdftocairo -pdf my.pdf - | pdftocairo -ps -level3 - result.ps and it will embed fonts, but that means custom filters for the CUPS server, and double processing for the file. Could pdftocairo please have an option to embed fonts if asked to? It seems to be capable of doing it, but doesn't have a way for PDF to PS conversion. Thanks!
I'm not sure what problem you are seeing. Cairo always embeds fonts in PDF and PS output. You should be able to see the embedded fonts with grep ^%%BeginResource <ps-file> The only way you would not get every font embedded is if the text has been replaced with a fallbacl image. You can check for fallback images with: grep '^% Fallback Image' <ps-file>
Created attachment 135769 [details] f.pdf
Created attachment 135770 [details] f-cairo.ps
Created attachment 135771 [details] f-pdftops.ps
Sorry, my PostScript knowledge is close to zero, I thought it was because of the fonts. I appreciate the explanation, thank you. Maybe we're looking at a bug then. Here is the original pdf: f.pdf Also two PS files produced by pdftocairo -ps -level3 f.pdf f-cairo.ps and pdftops -ps -level3 f.pdf f-pdftops.ps pdftops version prints perfectly, no issues. pdftocairo version is rejected by the printer, it says %%[ Error: undefined; OffendingCommand: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ]%% %%[ Flushing: rest of job (to end-of-file) will be ignored ]%% Why would the printer be unhappy about the cairo version, is there anything wrong in that PS file?
I can reproduce the issue on my printer with your f-cairo.ps file. I also tried converting f.ps to ps using current cairo git and it worked. I don't know is wrong with the 1.14.10 version but it seems to be fixed now. Try it with cairo git and see if it works for you.
(In reply to Alex Korobkin from comment #5) > %%[ Error: undefined; OffendingCommand: > zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ]%% > %%[ Flushing: rest of job (to end-of-file) will be ignored ]%% The zzzz is in the image data. It is data leftover after the image has been read and the PS parser chokes on it. There is already a fix for that in cairo 1.14.10: https://cgit.freedesktop.org/cairo/commit/?h=1.14&id=0aafba93f796758aebb2f8c3b4585b049dc0c30c I built 1.14.10 and confirmed the PS output prints correctly. I'm not sure why you have cairo output that contains the '1.14.10' version but does not contain this fix. Your output is missing the 'cairo_flush_ascii85_file' stuff in the PS Prolog so your version does not contain this fix.
Thank you! I tested with 1.15.8, it certainly works now.
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.