> > > Hi, > the PDF you sent uses NotoSans font, which is not one of the Base14 > fonts. The PDF is also such large, because it embeds the font. Using > Base14 fonts will make the file tiny. > > Actually seems base 14 fonts cannot be used with identity encoding. Try this:
``` PdfMemDocument doc; PdfFont *font = doc.CreateFont("Helvetica", false, false, false, PdfEncodingFactory::GlobalIdentityEncodingInstance()); PdfPage *page = doc.CreatePage({0, 0, 500, 800}); PdfPainter painter; painter.SetPage(page); painter.SetFont(font); painter.DrawText(30, 770, "Abcde"); painter.FinishPage(); doc.Write("x.pdf"); ``` It produces 263 kB pdf file so I cannot send it here. Most of that are widths for 65536 characters. Screenshot of how it looks is attached. Not only there is bad spacing, instead of first character 'A' is there '!' and they are uppercase? And acrobat displays warning "A number is out of range.". With version 0.9.3 (r1650) weights are not present so file is small but it is looking exactly same as with latest podofo. Pdf attached. I am not sure whether I already reported this (also what with rest of bugs which I reported and also sent patches which are still not fixed?). So until is this not fixed the best is to use base 14 fonts only without identity encoding. And when using identity encoding either suppress base 14 fonts: doc.CreateFont("Helvetica", false, false, false, PdfEncodingFactory::GlobalIdentityEncodingInstance(), PdfFontCache::eFontCreationFlags_None); This will select Helvetica from system fonts. Or the best is to use font subsetting so pdf is much more smaller (but not as small as with base 14): doc.CreateFontSubset("Helvetica", false, false, false, PdfEncodingFactory::GlobalIdentityEncodingInstance()); This will raise exception "PODOFO_RAISE_ERROR_INFO( ePdfError_UnsupportedFontFormat, "Required TrueType table missing" );" on OSX. Helvetica here is in .ttc file but for example Arial and many other fonts are working. [image: Screenshot 2019-02-14 at 12.56.12.png]
0.9.3(r1650).pdf
Description: Adobe PDF document
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users