Android PdfDocument file size

后端 未结 5 1600
予麋鹿
予麋鹿 2021-01-05 02:03

I want to generate a PDF File from a View using the PdfDocument android class introduced in KitKat. I managed to do it, and the file is so far generated ok, end

5条回答
  •  情歌与酒
    2021-01-05 02:34

    There are a few main things that increases the size of a PDF file:

    hi-resolution pictures (where lo-res would suffice)
    embedded fonts (where content would still be readable "good enough" without them)
    PDF content not required any more for the current version/view (older version of certain objects)
    embedded ICC profiles
    embedded third-party files (using the PDF as a container)
    embedded job tickets (for printing)
    embedded Javascript
    and a few more
    

    Try using iText. Following links give a basice idea for iText in android.

    http://technotransit.wordpress.com/2011/06/17/using-itext-in-android/

    http://www.mysamplecode.com/2013/05/android-itext-pdf-bluetooth-printer.html

    https://stackoverflow.com/a/21025162/3110609

提交回复
热议问题