Weird PDF issue with Calibri font

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Weird PDF issue with Calibri font

Postby matthewd » Sat Jul 06, 2024 3:53 am

We have a customer using the Windows Calibri font for invoices, and when they save a PDF copy of the invoice from the VPE Print Preview window and display the resulting PDF, it is missing two characters, specifically "6" and "8". Where those numbers should appear there is a blank space.

If we switch to a different font like Arial, there is no problem. I tried a few others like Lucia Sans, Tahoma and they are ok as well.

We are using VPE 7.1; I tested with a trial of 7.3 and got the same results.

We are calling VpeSetEmbedAllFonts and VpeSetSubsetAllFonts to embed and subset all fonts.

We can print the invoice to a PDF print driver (Foxit, Microsoft) from the Print Preview window and get a correct PDF file. Foxit PDF viewer shows the Calibri font is embedded/subsetted in those files.

If we use VpeSetFontControl to specify that Calibri should be embedded and subsetted instead of VpeSetEmbedAllFonts/VpeSetSubsetAllFonts then it is embedded, but the PDF file size is much larger.

I used the following (DataFlex) test code which calls VPE DLL functions to reproduce on the simplest possible file:

Move (VPEOpenDoc(hWnd,"VPE Calibri Embed Font Test",0)) to hDoc
Move (VpeLicense(hDoc,pVLicense1(Self),pVLicense2(Self))) to iRetVal
Move (vpeSetUnitTransformation(hDoc,254000)) to iRetVal
Move (VpeSetPageFormat(hDoc, VPAPER_LETTER)) to iRetVal
Move (VpeSetEmbedAllFonts(hDoc,1)) to iRetVal
Move (VpeSetSubsetAllFonts(hDoc,1)) to iRetVal
// Move (VpeSetFontControl(hDoc,'Calibri','',True,True)) to iRetVal
Move (VPESelectFont(hDoc,"Calibri",12)) to iRetVal
Move (VPEWrite(hDoc,0.25,0.25,8.0,0.5,'Calibri 0123456789 The quick brown fox jumped over the lazy dog.')) to nRetVal
Move (VPEPreviewDoc(hDoc,0,VPE_SHOW_MAXIMIZED)) to iRetVal

With the above code, VpeSetEmbedAllFonts/VpeSetSubsetAllFonts is uncommented and VpeSetFontControl is commented, we get a 19kb PDF file with blank spaces where the "6" and "8" should be. Uncommenting VpeSetFontControl and commenting VpeSetEmbedAllFonts/VpeSetSubsetAllFonts results in a 759Kb file that looks fine. Commenting all three lines to not embed the font at all results in a 3Kb file.

Any ideas/suggestions? I think we will just suggest the customer use a different font, or provide an option to not embed at all. If this is something IdealSoftware would like to look into further I can provide sample PDFs if that would be helpful.

(I have read about several problems related to the Calibri font/PDFs but nothing like this.)

EDIT: One other detail that I just got from the customer.

When opening the PDF file saved from the VPE Print Preview window in Adobe Acrobat Reader, Acrobat displays the message: "Cannot extract the embedded font 'PHQGHU+Calibri'. Some characters may not display or print correctly."

I have been using FoxIt PDF Reader and Chrome to view the problem PDF files. Neither of these viewers displays the message, but all do not render the '6' or '8' characters.
matthewd
 
Posts: 5
Joined: Wed Sep 28, 2016 10:54 pm

Re: Weird PDF issue with Calibri font

Postby IDEAL Software Support » Tue Aug 06, 2024 9:37 am

This issue has been fixed in the latest release v7.30 R1 of VPE.

See https://idealsoftware.com/en/support/history_list.html
IDEAL Software Support
 
Posts: 1629
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 20 guests