#1 2018-06-28 12:59:43

LiorI
Member
Registered: 2018-06-28
Posts: 3

PDF file size when embeding fonts

PDF filesize when I embed fonts is much more compered to a PDF file produced using NovaPDf printer.   
NovaPDF file size is about 80KB,  Synopse is about 300KB.
Without embeding fonts Synopse file size is only 10KB.
When I look at file Font properties in Adobe Acrobat Reader the description of the fonts is different:
NovaPDF file:
Ariel
  Type:Type 1
  Encoding: Standard
  Actual Font: ArielMT
  Sctual Font Type: TrueType
ArielMT (Embeded Subset)    <=== Note the "subset" description. It is missing in the Synopse properties description
  Type: TrueType(CID)
  Encoding: Identity-H
...

Synopse File:
Ariel (Embeded)
  Type: TrueType
  Encoding: Ansi
Ariel (Embeded)
  Type: TrueType (CID)     
  Encoding: Identity-H
...

I use Synopse Version 1.18,  QuickReport 5.02.2  and Delphi 7

Here is the code:
    Pdf := nil;
    try
      Pdf := TPdfDocument.Create;
      Pdf.UseUniscribe := True;
      Pdf.EmbeddedTTF := True;
      Pdf.EmbeddedWholeTTF := False;
      Pdf.UseOptionalContent := True;
      Pdf.StandardFontsReplace := True;

      Pdf.DefaultPaperSize := psA4;
      Pdf.DefaultPageLandscape := TQuickRep(quRep).Page.Orientation = poLandscape;
      if not Assigned(TQuickRep(quRep).QRPrinter) then
        TQuickRep(quRep).Prepare;
      for i := 1 to TQuickRep(quRep).QRPrinter.PageCount do
      begin
        Pdf.AddPage;
        aMeta := TQuickRep(quRep).QRPrinter.GetPage(i);
        try
          Pdf.Canvas.RenderMetaFile(aMeta,1,0,0);
        finally
          aMeta.Free;
        end;
      end;
      Pdf.SaveToFile(iif(aAppend, NewRepFile, strSFileName));
    finally
      Pdf.free;
    end;

Offline

#2 2018-06-28 16:20:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: PDF file size when embeding fonts

On which OS?

For embedding the sub-set, we use a Windows API call, which may not be available on oldest Windows.

Online

#3 2018-06-28 16:49:15

LiorI
Member
Registered: 2018-06-28
Posts: 3

Re: PDF file size when embeding fonts

Does this API exists in Win7 Pro version ?

Offline

#4 2018-06-28 18:21:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: PDF file size when embeding fonts

Yes, it does.

What is the pdf size if EmbeddedWholeTTF is set to true?

Try to debug if CreateFontPackage() is called as expected.
If it is called, then it is a limitation of this API itself.

Online

#5 2018-07-02 09:35:00

LiorI
Member
Registered: 2018-06-28
Posts: 3

Re: PDF file size when embeding fonts

>What is the pdf size if EmbeddedWholeTTF is set to true?
If EmbeddedWholeTTF is set to true file size increases from 180KB to 900KB.

>Try to debug if CreateFontPackage() is called as expected.
It seems that CreateFontPackage() is called.

Does using non latin character such as Hebrew increases file size ? Embeded fonts are of the Ariel family.
I had to embed Ariel since some of the clients could not read the document.
Maybe Ariel was not installed or their default reader doesn't have Ariel, for example in Android.

Offline

Board footer

Powered by FluxBB