PDF files huge when Window font gets deleted

  • wPDF 2.94
    WPTools 4.25 and WPTools 5.40

    When I create a PDF using WPTools and wPDF, I get a file size of about 170K for the doc I have created. However, if I delete the Arial font (the primary font used in the WPTools text) from Windows, the resulting PDF file is 13MB!! And takes Acrobat a long long time to gather the font info (only at 41% after 20 minutes).

    What I see so far is several subsets are now included that weren't before, but 13MB worth?! (I've configured wPDF to only include subsets of any fonts not on our exclude list of maybe four fonts, one of which is Arial by-the-way). I've dumped the large PDF file, and sure enough it looks like the Verdana font subset is included a billion times! (not quite that many, but close)

    This is the first time it has been reported to us but is easily reproducible, and I'm not sure how the customer's Arial font went missing, but I'm concerned that since we can email WPTools text around to other customers in the form of "templates", that one customer might email a template containing a font that is not in other person's Windows, and then goes to create the PDF file, and it comes out huge!

    Huge is bad since these are emailed.

    So, any idea why the includion of the same font almost a billion times? I can email you links to both files so you can compare if you'd like.

    Eric

  • I did a google search on missing arial font, and it seems quite a few people have reported their arial font goes missing for some reason... as did this one customer.

    I was concerned with how the PDF you generate gets filled up with a font inclusion ... like for each character.. over and over. I'm not sure how your logic works in creating the PDF if the richtext has arial but can't get the info for the font and responds with a substitution. And since I set it up to include font subsets, it is as if your PDF creator is including the font subset for each char in the doc since the substituted font is not in the exclude list, going through this same loop for each char.

    Could this be what is happening (hope I was clear)... and if so, can you do anything about it?

    Thanks,
    Eric

    • Offizieller Beitrag

    Hi,

    I would suggest that You check in Your application before launching the export if Arial is missing. It would be simple

    Screen.IndexOf('Arial') = 0

    If You add "Arial" to the "ExcludedFont" list in this case it should be ok.

    I will add this to the default code if You can find out that this helps. I don't have a machine to test that.

    Julian

  • Arial is already in my excluded fonts list... and I think that is related in that it is the substituted font that is not in the excluded list... so I would need to know what that font will be so I can exclude it. For example, it looks like it used Verdana in place of Arial when Arial was missing, so it included a subset of Verdana over and over and over and over.