1. Bernhard Stoeter
  2. PowerBuilder
  3. Friday, 2 July 2021 09:01 AM UTC

I’m using the PowerBuilder 2019R2 (2353) NativePDF way (PBPDF190.dll) to create PDF docs:

lds_Print.Object.DataWindow.Export.PDF.Method = NativePDF!
lds_Print.Object.DataWindow.Export.PDF.NativePDF.ImageFormat = '2'    // 'PNG'
lds_Print.Object.DataWindow.Export.PDF.NativePDF.UsePrintSpec = 'Yes'
lds_Print.Object.DataWindow.Export.PDF.NativePDF.PDFStandard = 0
li_rc = lds_Print.SaveAs( "c:\temp\file.pdf", PDF!, FALSE )

I discovered that some fonts are embedded in the PDF doc and some are not. If a used font is not present at the viewers site no text is displayed when viewing the PDF doc with acrobat reader.

Is there a way to control which and how fonts are embedded?

Thanks in advance
Bernhard

Bernhard Stoeter Accepted Answer Pending Moderation
  1. Thursday, 8 July 2021 13:49 PM UTC
  2. PowerBuilder
  3. # 1

Hi Mark,

 

thank you. I will submit a bug ticket.

Regards,

Bernhard

Comment
  1. Mark Lee @Appeon
  2. Monday, 12 July 2021 02:30 AM UTC
Hi Bernhard,



Thanks for submitting ticket 6911.

I can reproduce it on our side. Currently the NativePDF doesn't support using AddFontResourceEx function to mark a font as private or not enumerable.

So in your test case, you must use the AddFontResourceW and RemoveFontResourceW functions instead of the AddFontResourceExW and RemoveFontResourceExW functions because when ‘packaging custom fonts in the generated PDF file’ is checked, the custom fonts must be a public or enumerated type. Otherwise, it will have permission issues and fail to load the custom font when using the NativePDF feature.

https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-addfontresourcew



Regards,

  1. Helpful
  1. Armeen Mazda @Appeon
  2. Monday, 12 July 2021 02:49 AM UTC
Thanks Mark for sharing the solution!
  1. Helpful
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Thursday, 8 July 2021 06:05 AM UTC
  2. PowerBuilder
  3. # 2

Hi Bernhard,

 

For the issue 'In Fonttest(4).pdf and Fonttest(5).pdf "Tahoma" is embedded (which is wrong)', please submit a ticket about it to our ticket system: https://www.appeon.com/standardsupport/newbug so it can be properly received and tracked.
Please also provide a sample PB test case (including PBT / PBL ) when submitting.

BTW, I checked the PDFs you provided and found that Fonttest(6).pdf shows the related barcode correctly but the others not.

What should happen if I use a “Windows auto-installed” font when viewing the PDF on a Linux based machine?
Answer: if the custom fonts are packaged into the generated PDF files, these PDFs will display correctly in Linux machine.

 

 

Regards,

Comment
There are no comments made yet.
Bernhard Stoeter Accepted Answer Pending Moderation
  1. Wednesday, 7 July 2021 08:01 AM UTC
  2. PowerBuilder
  3. # 3

Hi Mark,

I tried working with checked „Packaging custom fonts in the generated PDF files“.

Embedding dynamically loaded fonts doesn’t work, see attached PDFs (in FontIssues3.zip):

Fonttest(4).pdf: “3 of 9 extended” dynamically load, NativePDF.PDFStandard = 0
Fonttest(5).pdf: “3 of 9 extended” dynamically load, NativePDF.PDFStandard = 2
Fonttest(6).pdf: “3 of 9 extended” installed, NativePDF.PDFStandard = 0
Fonttest(7).pdf: “3 of 9 extended” installed, NativePDF.PDFStandard = 2

In Fonttest(4).pdf and Fonttest(5).pdf “Tahoma” is embedded (which is wrong) and in Fonttest(6).pdf and Fonttest(7).pdf “Free3of9Extended” (which is current).

The last (3.) line in all PDFs is generated by:
text(name=do_3 visible="1         if( page() = 1, 1, 0 )" pointer="Arrow!" tag="donr=29000000;apdf=J;länge=18400;" band=detail font.charset="1" font.face="Free 3 of 9 Extended" font.family="0" font.height="-12" font.italic="0" font.pitch="0" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="1" background.color="553648127" color="0" alignment="0" border="0" x="2000" y="1583" height="317" width="974" text="3of9" )

The definition of “custom font” is strange to me. What should happen if I use an “Windows auto-installed” font when viewing the PDF on a Linux based machine?

Regards,
Bernhard

Attachments (1)
Comment
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 7 July 2021 04:59 AM UTC
  2. PowerBuilder
  3. # 4

Hi Bernhard,

 

Please check my replies to your questions below: 

- What is a "custom font" or when will a font be a "custom font"?

[Mark] 'Custom font' is the default font that that Windows won't auto-install, for example, the barcode font like code 128 or code 39, etc. BTW, it is just like the barcode font you used in your case.

 

" What is about fonts which are not permanantly installed but dynamically loaded via GDI32.DLLs AddFontResourceEx/RemoveFontResourceEx?"

[Mark] These fonts still mean the 'custom font' I explained above.

 

Regards,

Comment
There are no comments made yet.
Bernhard Stoeter Accepted Answer Pending Moderation
  1. Tuesday, 6 July 2021 10:08 AM UTC
  2. PowerBuilder
  3. # 5

Hi Mark,

thanks your for hint. I will try that.

But there are two more questions concerning font handling:

- What is a "custom font" or when will a font be a "custom font"?

- What is about fonts which are not permanantly installed but dynamically loaded via GDI32.DLLs AddFontResourceEx/RemoveFontResourceEx?

Regards,

Bernhard

Comment
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 6 July 2021 09:17 AM UTC
  2. PowerBuilder
  3. # 6

Hi Bernhard,

 

We had adjusted some features in PowerBuilder 2019 R2 GA.

The two INI settings NativePDF_IncludeCustomFont and NativePDF_Valid no longer take effect since PowerBuilder 2019 R2 GA.

You can refer to the following link for detail.

https://docs.appeon.com/pb2019r2/whats_new/ch01s09.html 


As for how to solve it, you can go to the Application Properties dialog box, check the "Packaging custom fonts in the generated PDF files" and then save it.

For more, see the section called “Saving as PDF using NativePDF! method with PDFlib” in the Users Guide.

 

Regards,

 

Comment
There are no comments made yet.
Bernhard Stoeter Accepted Answer Pending Moderation
  1. Monday, 5 July 2021 09:28 AM UTC
  2. PowerBuilder
  3. # 7

Hi Armeen,

thank you for your quick response.

I tried it but I couldn't get it working. See attached file FontIssues.zip:

Datawindow(1).srd was saved to PDF from IDE without NativePDF_IncludeCustomFont=1 line in pb.ini, resulting in Fonttest(1).pdf.
Datawindow(2).srd was saved to PDF from IDE with NativePDF_IncludeCustomFont line=2 in pb.ini, resulting in Fonttest(2)pdf.
(1) and (2) used nativepdf.pdfstandard=0.

Then I changed to DataWindow(3).srd where saving to PDF results in Fonttest(3).pdf.
(3) used nativepdf.pdfstandard=2.

I work with "Times New Roman" and "Arial" (permanently installed in Windows) and "Free 3 of 9 Extended" (dynamically loaded while running the application).

In "Screenshot 2021-07-05 102327.jpg" you see whow PowerBuilder displays the datawindows.

The same happens when working with deployed applications.
The pb.ini files were located as described in the manual.

Problems seem to occure when fonts are not installed, also when viewing the PDFs under Linux.

By the way:
I use Windows 10 ProfEdition newest patch level and german language and regional settings.

What am I missing?

Bernhard

Attachments (1)
Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 2 July 2021 16:03 PM UTC
  2. PowerBuilder
  3. # 8

You sure can embed custom fonts.  It is written in the documentation: https://docs.appeon.com/pb2019/application_techniques/ch35s08.html#Using_the_PDFlib

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.