memotrio.blogg.se

Gembox help structure
Gembox help structure






gembox help structure

PdfDocument can be saved to a new PDF file by specifying a path to a PDF file via PdfDocument.Save(String) method or by specifying a PDF file stream via PdfDocument.Save(Stream) method.Īll save operations on the PdfDocument use the same PdfSaveOptions instance specified in the SaveOptions property to control the details of the output PDF file structure. Saving the PDF document to a new PDF file PdfDocument is still fully usable at this point if it was loaded to memory before, as explained in the preceding subsection.Ĭlosing/disposing the PdfDocument instance with Close() or Dispose() method does not mean that the PdfDocument instance cannot longer be used, it just means that the associated PDF file is closed and that the PdfDocument instance is no longer associated with any PDF file. This operation will close the associated PDF file.Īt this point, all PdfIndirectObjects in a PDF document will have an Id equal to Undefined until they are written to a PDF file. If PdfDocument instance will no longer be used, but is associated with the PDF file (either because it was loaded from a PDF file or saved to a PDF file), then it must be closed or disposed by calling Close() or Dispose() method.

gembox help structure

If you do not load the PdfDocument instance to a memory before disposing the associated PDF file, then an exception might occur if some indirect object's value is requested for the first time and it is not possible to parse it from a closed PDF file. Then the associated PDF file can be disposed as explained in the next subsection.Įffectively, this operation will read the PDF file in an eager fashion (values of all indirect objects accessible from the PdfDocument instance will be, if not already, parsed at that point). If you want to dispose the associated PDF file, but still want to be able to fully use the PdfDocument instance, then PdfDocument instance first must be fully loaded from the associated PDF file to memory by using the Load() instance method. This feature enables GemBox.Pdf to perform fast reading and updating of the PDF file. Loading a PDF document fully to a memoryĪ PDF file associated with the loaded PdfDocument must remain open because GemBox.Pdf reads the PDF file in a lazy fashion (indirect object values are parsed from the PDF file only when they are requested for the first time). Any PDF document that is associated with the PDF file should be closed (disposed), otherwise memory and resource leaks might occur because the PDF file stream might not be closed until the application exists. PdfIndirectObjects created with GemBox.Pdf will have an Id equal to Undefined until they are written to a PDF file.Ī loaded PDF document is associated with the PDF file from which it was loaded, and the PDF file remains opened until Close() or Dispose() method is called.

gembox help structure gembox help structure

PdfIndirectObjects read from the PDF file will have a unique Id that is different than Undefined. For more information, see ReadOnly property. Overloads that do not accept PdfLoadOptions as a parameter will use Default.Ī PDF document can be loaded in a read-only mode to prevent accidental changes to the PDF file. PdfDocument can be loaded from a PDF file either by specifying a path to a PDF file via PdfDocument.Load(String) or PdfDocument.Load(String, PdfLoadOptions) methods or by specifying a PDF file stream via PdfDocument.Load(Stream) or PdfDocument.Load(Stream, PdfLoadOptions) methods. PdfIndirectObjects created with GemBox.Pdf will have an Id equal to Undefined until they are written to a PDF file. This PDF document is contained entirely in memory and is not associated with any PDF file. To make the PDF document valid, at least one page should be added to it after its creation. To create a new in-memory PDF document, use the PdfDocument constructor. The following subsections give more details about each PDF file-structure-related operation in GemBox.Pdf. PdfLoadOptions type and its members and.Interface to the PDF file structure in GemBox.Pdf is exposed through the following members: Implementation of the PDF file structure is currently not exposed through GemBox.Pdf interface. The following section describes how GemBox.Pdf provides loading and saving of a PDF document to a PDF file, efficient random access of objects in a PDF file, incremental updates of a PDF file and other PDF file-related functionalities. This structure is independent of the semantics of the objects. The PDF file structure determines how objects are stored in a PDF file, how they are accessed, and how they are updated.








Gembox help structure