Have two pdfs, first created with libharu and second created with PDF::API2. If not mention to coordinates then content is the same. But first pdf oversize second by four times. Only one distinction what i found that is type of fonts embedding showed in document properties fonts tab.
Verdana (Embedded Subset) Type: TrueType Encoding: Custom
Verdana Type: TrueType Encoding: Custom Actual Font: Verdana Actual font Type: TrueType
How to deal with that embedded subset?Answer1:
There are many factors that affect the size of the PDF. Your problem <em>may</em> be in the way the PDF creation libraries handle font embedding, specifically:<ul><li>"Embedded subset" means that part of the font's metrics, like glyph widths, are included in the file.</li> <li>If the font is not embedded, presumably it is loaded by the reader from the system, reducing the size of the file.</li> </ul>
<em>If</em> the PDF is already small (only has one page, little text and no images), embedding fonts may make a relatively big difference on the size of the document. Still, in absolute terms, an embedded font shouldn't take a lot of space.
Another factor you should check is compression. PDF is mostly a plain-text stream, but it usually comes in compressed form. Try opening both PDFs in a plain text editor and see if it's readable or gibberish. The gibberish (compressed) form will naturally take less space.
Finally, you can inspect the objects the PDF file is composed from using the many PDF inspectors out there, for example <a href="http://sourceforge.net/projects/itextrups/" rel="nofollow">this one</a> (I just googled it up, no guarantees it'll work as expected).Answer2:
this is an old question but I had a similar issue.
Did you set libharu to compress your pdf?
in C++, from the <a href="https://github.com/libharu/libharu/wiki/Usage-examples" rel="nofollow">documentation</a>
HPDF_SetCompressionMode (pdf, HPDF_COMP_ALL);