The DocumentPage Structure is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.
Data for one page to be added to a document file.Visual Basic (Declaration) | |
---|---|
Public Structure DocumentPage Inherits System.ValueType |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As DocumentPage |
C# | |
---|---|
public struct DocumentPage : System.ValueType |
C++/CLI | |
---|---|
public value class DocumentPage : public System.ValueType |
The DocumentPage structure contains the data for one page to be added to a document file. It is used as a parameter to the DocumentWriter.AddPage method used to add the page.
The DocumentPage.EmfHandle property must contain a valid Windows Enhanced Meta File handle (EMF) that contains the visual representation of the page. This EMF handle can obtained through multiple sources as explained in DocumentWriter.
The DocumentPage.Image property is optional and is used only when the document being created is PDF with the Image/Text overlay option. To create a PDF document with image/text overlay, perform the following steps:
- Set the value of the PdfDocumentOptions.ImageOverText to true. You can use the DocumentWriter.GetOptions and DocumentWriter.SetOptions methods to the get the options used when saving a PDF document.
- Call DocumentWriter.BeginDocument with DocumentFormat.Pdf as the format to use.
- Add the document pages. The DocumentPage.EmfHandle property must point to the EMF representation of the page and the DocumentPage.Image must contain a Leadtools.RasterImage object for the image to be used as the overlay for the page.
- Repeat for each page in the document.
- Call DocumentWriter.EndDocument to finish creating the document file on disk.
The Dots/Inch (DPI) of the page is the same as the DPI stored in the DocumentPage.EmfHandle property. Therefore, to create a page with 300 DPI, you must add a document page with an EMF that has a DPI of 300 (both horizontally or vertically although the LEADTOOLS Document Writer supports different values for the DPI). If you are using the PDF with image/text feature, you must set the DPI of the Leadtools.RasterImage object to the same DPI as the EMF handle using the RasterImage.XResolution and RasterImage.YResolution properties. To override this behavior and set a custom resolution, set the value of the DocumentOptions.DocumentResolution property to the desired final resolution. This value will be used instead of the resolution of the EMF handle.
The LEADTOOLS Document Writer supports creating documents with zero or more empty pages inside them. Simply add a page with the DocumentPage.EmfHandle property set to the default value of IntPtr.Zero and call the DocumentWriter.AddPage method. The dimension of the empty page must be set before hand in the DocumentOptions.EmptyPageWidth and DocumentOptions.EmptyPageHeight and its resolution set to DocumentOptions.EmptyPageResolution. As many empty pages as desired can be added in any index desired. To use empty pages, make sure the DocumentOptions.PageRestriction property is set to DocumentPageRestriction.Relaxed.
For more information, refer to PdfDocumentOptions.
System.Object
System.ValueType
Leadtools.Forms.DocumentWriters.DocumentPage
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7