1

I'm generating PDFs from HTML (using ABCPdf and C#) and the files are coming out a reasonable size. However, I'm interested in any tips anyone has for making the PDFs as small as possible.

Anyone for any great ideas?

The HTML being rendered is really basic, just a table of names and dates etc - doesn't have to be too pretty.

Cheers!

-Ev

Ev.
  • 7,109
  • 14
  • 53
  • 87
  • 1
    What sizes do you currently have? Most compression techniques I know are centered around images and such. Not sure how much can be squeezed from a pure table – Pekka Feb 11 '11 at 00:41
  • Do you know if any font data is being embedded in the generated PDF? – Dwight Kelly Feb 11 '11 at 15:53

2 Answers2

1

If layout is so simple, then try to relinquish the generation from HTML and write PDF directly with C# tools and libs. Read the data form HTML shouldn't be a problem.

p4553d
  • 818
  • 1
  • 7
  • 17
0

If you aren't already using the Flatten method, that will give you back some of the space that is not necessarily required. Be warned that you don't get much back from this when the PDF is very simple, but it's worth a try.

Check the documentation for more info, it does mean that if you want to open and modify the same PDF later that it simplifies and compresses the data in the file and so it's more complicated to walk over it and make changes.

Mike Edgar
  • 39
  • 2