Hi Palmer,

Your subsetting patch looks very promising, but I have a few issues with
> it. For example, in the current HEAD, the following code works fine (I open
> an existing PDF and write some text on its pages with the Arial font). If I
> apply the patch and run the same test, the result is a corrupted  PDF file
> (according to Adobe Reader: Invalid font data).
> encoding = PoDoFo::PdfEncodingFactory::GlobalWinAnsiEncodingInstance();
> pdfFont = pdf->CreateFontSubset(fontName, isBold, isItalic, false,
> encoding, fontPath);
> Do you think you could look into this?



Here is a patch. Try it. It should work now with single byte encodings too
(even with difference encodings). See a modified helloworld-base14.cpp
sample.

Just ignore CRITICAL message. :))

D:\export\podofo\build\examples\helloworld-base14>helloworld-base14.exe
sample.pdf
CRITICAL: Cannot retrieve page 0 from a document with only 0 pages.
Courier Width = 338.4 Height = 9.432
Courier-Bold Width = 374.4 Height = 9.432
Courier-Oblique Width = 396 Height = 9.432
Courier-BoldOblique Width = 424.8 Height = 9.432
Arial Width = 287.309 Height = 13.7988
Helvetica-Bold Width = 341.448 Height = 11.1
Helvetica-Oblique Width = 346.656 Height = 11.1
Helvetica-BoldOblique Width = 386.124 Height = 11.1
Times-Roman Width = 302.46 Height = 10.8
Times-Bold Width = 303.336 Height = 10.8
Times-Italic Width = 293.772 Height = 10.8
Symbol Width = 281.352 Height = 10.8
ZapfDingbats Width = 434.472 Height = 10.8
MingLiU Width = 282 Height = 14.3906
Times-BoldItalic Width = 322.176 Height = 10.8
Traditional Arabic Width = 349.488 Height = 18.3926
Times New Roman Width = 358.658 Height = 13.7988
Verdana Width = 383.238 Height = 14.584
Arial Width = 283.312 Height = 13.7988
Courier New Width = 367.26 Height = 13.5938
Ms Gothic Width = 306 Height = 12
DejaVu Sans Width = 343.459 Height = 13.7988

Created a PDF file containing the line "Hello World!": sample.pdf

Attachment: subset2.patch.gz
Description: GNU Zip compressed data

------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to