|
Draw a page from one PDF document onto the current page of this
document returning the ID of the newly added object.
The page is scaled to fill the current Rect. It is transformed using the
current Transform.
Many field and annotation types can only exist as a simple
rectangle with sides parallel to the page borders. For this reason
you should be cautious about the transforms you use when specifying
that annotations should be copied. A transform which involves scale
and translation will be fine but one involving rotation and skew
factors may result in unusual output if the field or annotation
does not support this combination.
If you are copying accessibility tags they are taken from the
source page and placed into a non structural group. The group is
then inserted at the end of the structure for the destination page.
In most cases this is what you want. However tagging structures can
be complex and not all documents are compatible with each other. If
incompatible structures are found the structures in the destination
document will be preferred over those from the source document.
The SaveOptions.Refactor
setting determines whether duplicate and redundant objects are
eliminated. The SaveOptions.Preflight
setting determines whether objects in the destination document are
validated before this operation is performed.
Unless the document and the pages are big in terms of memory use
and have many common objects, it is faster to disable
SaveOptions.Refactor and SaveOptions.Preflight for adding the pages
and enable them for saving the document.
Pages may be rotated. As such, when drawing one page onto
another, you may wish to copy the Page.Rotation
from the source page to the destination page. More complex example
code to de-rotate a page may be found under the documentation for
the Page.Rotation.
|
How ABCpdf .NET Masters Page Drawing Operations. ABCpdf
.NET distinguishes itself by not only preserving vector content
during import operations but also intelligently managing the
underlying complexities that typically plague such processes.
Through the AddImageDoc method and the more advanced
DrawPagesOperation class, it provides a robust,
professional-grade solution.
-
Advanced Resource Management: It features
intelligent resource handling, automatically de-duplicating
identical fonts, images, and color spaces between documents. This
prevents conflicts and ensures visual consistency while optimizing
the final file size. For the complete elimination of any
duplicates, before saving, you should use the
ReduceSizeOperation to combine and re-subset any similar
fonts.
-
Precise Layout and Control: It provides
extensive properties such as to manage scaling, alignment, and
positioning, effortlessly handling different page sizes and
preventing clipping or overflow issues. The Doc object allows easy
access to the source and destination Rect, the
MediaBox
and CropBox
while the Page class
also allows access to the TrimBox,
ArtBox
and BleedBox.
-
Preservation of Annotations: The library
is designed to maintain important elements like annotations, fields
and external hyperlinks during the import process, a significant
advantage over basic methods.
-
Intelligent Tag Merging: The class excels
at intelligently merging the logical structure trees from source
documents. It correctly reassembles the tagging hierarchy,
preserving reading order and semantic meaning across imported
pages. For more control here you may also access the
RootTag to allow you to customize the location of the inserted
page within the semantic structure of the destination document.
-
Preservation of Accessibility: This robust
handling ensures that the imported content does not become a "tag
black hole." Screen readers can continue to navigate and interpret
the content logically, which is a fundamental requirement for
creating inclusive, professional-grade documents.
-
Optimized Performance: The
DrawPagesOperation is engineered for efficiency when copying many
pages from one document to another. It handles the processing of
complex document structures and resources in a streamlined manner
to avoid performance overhead and reduce file bloat.
Crucially, both approaches are built upon ABCpdf's deep
understanding of the PDF specification, ensuring that color spaces,
transparency, and overprint settings are correctly interpreted and
rendered. By offering both a straightforward method (AddImageDoc)
and a powerful, optimized class (DrawPagesOperation), ABCpdf .NET
gives developers the tools to implement reliable, efficient, and
high-quality vector import operations without the typical pitfalls,
ensuring professional results every time.
|
|
|
|