WPCubed Product Support

How to minimize PDF file size with wPDFControl

Support already responded with the solution. They are quick! 😃

Add the following line after calling wpdfInitialize.

SetIProp(WPPDF_USEFONTMODE, 0);

It worked like a charm!

#12 ♥ 0
26.7k Views 3 links 6 users read 3 min

I am having the same issue when using wPDFControl.dll. If I initialize the PDF context with wpdfInitialize(), simply printing a single word creates a 1MB file when it should only be <6KB. It looks like the default initialize is set to embed fonts.

I would like to use wpdfInitializeEx(WPDFInfoRecord*) but I am unsure of the defaults I should use. Since the project I'm working on has been using wpdfInitialize() I'd like to use the same default values, but this doesn't seem to be documented anywhere.

#11 ♥ 0

Dear All, Thanks a lot of this discussion, because i have learned these tips of embedding the font size increment, and also i have learned that if there are only a few pages, the increase will be relatively high.

#10 ♥ 0
support

Hi,

pdfPrint refers to WPViewPDF. There is no option to change the font size since this would require a refeormattion of the page - thats not possible in PDF.

I assume you just wanted to promote your links.

#9 ♥ 0
support

Hi,

I assume You need to use the Stretch option for pdfPrint. (See options string)

This will reduce the page to the selected page size.

There is no other way to reduce the font size.

Julian

#7 ♥ 0

I only try to print an existing pdf document.
I use pdfPrint method and the printed document has the fonts bigger then if I print them with Adobe reader.

Is there any option on the pdfPrint method to make the fonts as small as possible ?

#6 ♥ 0
support

Yes, this is the setting for smallest PDFs in case You need embedded font data.

Kind Regards,
Julian

#5 ♥ 0

Thank Julian. Can you confirm that I am use the correct options to obtain the smallest PDF size (with embedded fonts)?

#4 ♥ 0
support

Hi,

if fonts are embedded the size will increase. If there are only a few pages, the increaes will be relatively high.

The setting "use TTF fonts" produces the smalles PDF files.

Kind regards,
Julian

#3 ♥ 0

Could I bother someone at WPCubed for an answer to my question, please? Thanks.

Greg

#2 ♥ 0

We are generating PDFs with wPDFControl version 2.94. I'm seeing PDF file sizes 3-4 times larger than we have produced with other products and would like to make sure we are setting options correctly with wPDFControl.

I have the following constraint:

  1. I am using custom fonts and must make sure that the generated PDF can be properly rendered on systems without those fonts installed.

Here are the options I am using now:

pdfControl.SetLicense(...);
pdfControl.DefaultSize = wPDF.ePage.Letter;
pdfControl.FontMode = wPDF.eFontMode.EmbedTTFSubsetUsedChar;
pdfControl.PDFMode = (wPDF.eDevMode)(eDevMode.ClipRectSupport | eDevMode.AlwaysHighResPDF | eDevMode.ExactTextPositioning);
pdfControl.PDFOptions = wPDF.ePDFOptions.CreateAutoLinks;
pdfControl.Thumbnails = wPDF.eThumbnails.Color;
pdfControl.TextCompression = wPDF.eTextCompression.FastDeflate;

How do I satisfy my constraint (above) and minimize my PDF size?

I can submit PDF samples if needed.

Thanks.

Greg

#1 ♥ 0