Is there an equivalent to iText 5's PdfSmartCopy class in iText 7? If not, how do I achieve the same functionality in iText 7?
You can set the SmartMode property of a PdfWriter to true:
/**
* Sets the smart mode.
* <p/>
* In smart mode when resources (such as fonts, images,...) are
* encountered, a reference to these resources is saved
* in a cache, so that they can be reused.
* This requires more memory, but reduces the file size
* of the resulting PDF document.
*/
public PdfWriter setSmartMode(boolean smartMode)
Using such a PdfWriter to copy pages to is the equivalent of using a PdfSmartCopy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With