Embedding fonts when using PXCp_ APIs ?

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Support Staff, moderators

Post Reply
quest-ade
User
Posts: 48
Joined: Wed Sep 28, 2005 9:20 am

Embedding fonts when using PXCp_ APIs ?

Post by quest-ade » Tue Feb 17, 2009 2:31 pm

Hi,

We're using v3.6.0.130 and are using the PXCp_ APIs to combine multiple PDFs into a single PDF. We use APIs such as PXCp_OptimizeFonts etc to help control the output of the combined PDF.

However, what we need to do is to force all fonts to be embedded (so that when printing or users viewing on screen there are no issues over missing fonts) - I have found PXC_SetEmbeddingOptions which would seem to do the job but this API is not compatible with the PXCp_ ones - or is it?

Any help on how I can achieve this would be greatly appreciated.

Best regards,
Adrian

Lzcat - Tracker Supp
Site Admin
Posts: 711
Joined: Thu Jun 28, 2007 8:42 am

Re: Embedding fonts when using PXCp_ APIs ?

Post by Lzcat - Tracker Supp » Tue Feb 17, 2009 3:07 pm

xcpro cannot embedd fonts if it was not embedded, sorry. It can only merge two (or more) embedded fonts if possible, to reduce file size. Embedding fonts should be done when create PDF files, because later actual used fonts may be not avail (especially on different computer).
About PXC_... and PXCp_... functions you are right - they cannot be mixed becuse usage of different documents for different purposes (creation new pdf and modifying existing).
There is two ways how to embedd fonts, both require creation of new file.
1. If file contain only text and raster images (no vector drawings such lines, etc) you can try to extract text and images using xcpro library and create new pdf file using pxclib library. BUT:
- If pdf file containg any drawings they will be lost.
- Text in pdf file may be readable on screen but not extractable as unicode or ASCII text (in case when font is embedded and use custom embedded encoding without supplying ToUnicode table). In this case it will be converted to different characters and text beacme unreadable.
- If you system does not contain fonts, corresponding used into PDF file it will look different.
- You will lost annotations and almost all interactive features (only bookmarks may be readed and transferred).
2. You may print existing pdf file to virtual printer to produce new PDF. It will look almost same as original, BUT:
- You will lost all interactive features (ok, bookmarks may be transferred later).
- Resulting file may be seriously larger - some PDF objects will be rasterised when printing, including text.
- In general all embedded fonts will look same as in original pdf, but text cannot be extracted from result (in will contain glyph indexes instead of character codes).
So best solution to ensure that all fonts are embedded - do this during pdf creation, later is too late.
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

quest-ade
User
Posts: 48
Joined: Wed Sep 28, 2005 9:20 am

Re: Embedding fonts when using PXCp_ APIs ?

Post by quest-ade » Tue Feb 17, 2009 3:22 pm

Thank you for your quick answer - it confirmed what I had expected - that there is no way to force embedding of fonts during PDF combining.

Best regards,
Adrian

John - Tracker Supp
Site Admin
Posts: 8201
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: Embedding fonts when using PXCp_ APIs ?

Post by John - Tracker Supp » Tue Feb 17, 2009 4:18 pm

Pleasure :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply