iText7 中是否有等效的 PdfSmartCopy

Is there a PdfSmartCopy Equivalent in iText7

在 iText 7 中是否有与 iText 5 的 PdfSmartCopy class 等效的功能?如果没有,我如何在 iText 7 中实现相同的功能?

您可以将 PdfWriterSmartMode 属性 设置为 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)

使用这样的 PdfWriter 复制页面等同于使用 PdfSmartCopy.