tags:

views:

127

answers:

2

I am developing PDF to e-book converter which will run on a server.

I need to programmatically extract embedded fonts from PDF file to finish the project. Now I am able to extract images and text, but to display content in the Flash Player precisely I need the fonts to be extracted from PDF and compiled to SWF to be loaded by Flex application at run time.

I am wondering if it's possible, as such tool as pdf2swf.exe from SWFTools is able to do this. I have decompiled the swf file produced by the tool and there were fonts embedded.

The extracted fonts will be used for displaying the same content from PDF file only, just in Flash player. So i think it will not be any rights violation? Moreover, people who will use the converter have all rights for the PDF files content.

So I see next workflow: 1. Call pdf2swf.exe to produce SWF file with fonts embedded; 2. Call some tool (Which one?) to parse previous SWF to SWFs with separate fonts. 3. Load the SWFs with fonts to Flex application at run time to correctly display content.

It would be great if there is some tool to extract fonts from PDF directly to SWFs.

+1  A: 
bhups
Thank you for the very useful comment. I have rewrote the script to a DOS batch, however now I'm puzzled how can I use generated SWF in my Flex project if it doesn't contain actual font name but just numeric code?
Max
+1  A: 

If the font is subsetted, you will need to use the same subsetting as in the PDF file to make and sense of it.

mark stephens
As the font will be used to display exactly the same content as in PDF file, I think it isn't a problem?
Max