Class PdfFileStructure
This class represents a set of the properties that define the internal structure of PDF file.
Inheritance
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfFileStructure
Examples
//Create a new document
PdfDocument doc = new PdfDocument();
//Create a new page
PdfPage page = doc.Pages.Add();
//Create new instance for PDF file structure.
PdfFileStructure structure = new PdfFileStructure();
//Set the file structure cross reference type.
structure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream;
//Set the document`s file structure.
doc.FileStructure = structure;
// Save the document
doc.Save("FileStructure.pdf");
doc.Close(true);
'Create a new document
Dim doc As New PdfDocument()
'Create a new page
Dim page As PdfPage = doc.Pages.Add()
'Create new instance for PDF file structure.
Dim pdfstructure As PdfFileStructure = New PdfFileStructure()
'Set the file structure cross reference type
pdfstructure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream
'Set the document`s file structure
doc.FileStructure = pdfstructure
'Save the document
doc.Save("FileStructure.pdf")
doc.Close(True)
Constructors
PdfFileStructure()
Initializes a new instance of the PdfFileStructure class.
Declaration
public PdfFileStructure()
Examples
//Create a new document.
PdfDocument doc = new PdfDocument();
//Create a new page.
PdfPage page = doc.Pages.Add();
PdfFileStructure structure = new PdfFileStructure();
//Set the document`s cross reference type
structure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream;
//Set the PDF version.
doc.FileStructure = structure;
//Draw the text.
page.Graphics.DrawString("File structure", new PdfStandardFont(PdfFontFamily.Courier, 12), PdfBrushes.Green, new PointF(10, 10));
//Save and close the document.
doc.Save("FileStructure.pdf");
doc.Close(true);
'Create new document.
Dim doc As PdfDocument = New PdfDocument()
'Add new page.
Dim page As PdfPage = doc.Pages.Add()
'Create new instance for PDF file structure.
Dim pdfstructure As PdfFileStructure = New PdfFileStructure()
'Set the document`s cross reference type
pdfstructure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream
'Set the PDF version.
doc.FileStructure = pdfstructure
'Draw the text.
page.Graphics.DrawString("File structure", New PdfStandardFont(PdfFontFamily.Courier, 12), PdfBrushes.Green, New PointF(10, 10))
'Save and close the document.
doc.Save("FileStructure.pdf")
doc.Close(True)
See Also
Properties
CrossReferenceType
Gets or sets the type of PDF cross-reference.
Declaration
public PdfCrossReferenceType CrossReferenceType { get; set; }
Property Value
Type | Description |
---|---|
PdfCrossReferenceType |
Remarks
Please see the description of PdfCrossReferenceType for more details.
Examples
//Create a new document
PdfDocument doc = new PdfDocument();
//Create a new page
PdfPage page = doc.Pages.Add();
// Set the document`s cross reference type
doc.FileStructure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream;
// Set the PDF version
doc.FileStructure.Version = PdfVersion.Version1_6;
// Save the document
doc.Save("FileStructure.pdf");
doc.Close(true);
'Create a new document
Dim doc As New PdfDocument()
'Create a new page
Dim page As PdfPage = doc.Pages.Add()
' Set the document`s cross reference type
doc.FileStructure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream
' Set the PDF version
doc.FileStructure.Version = PdfVersion.Version1_6
' Save the document
doc.Save("FileStructure.pdf")
doc.Close(True)
EnableTrailerId
Gets or sets a value indicating whether the trailer Id is added or not to the PDF document.
Declaration
public bool EnableTrailerId { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | If true trailer Id is added to the PDF document, otherwise false. Default value is false |
IncrementalUpdate
Gets or sets a value indicating whether [incremental update].
Declaration
public bool IncrementalUpdate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
// Load an existing document
PdfLoadedDocument lDoc = new PdfLoadedDocument("SourceDoc.pdf");
// Sets the incremental update as True
lDoc.FileStructure.IncrementalUpdate = true;
//Create a new page
lDoc.Pages.Add();
// Saves the document
lDoc.Save("FileStructure.pdf");
lDoc.Close(true);
' Load an existing document
Dim lDoc As New PdfLoadedDocument("SourceDoc.pdf")
' Sets the incremental update as True
lDoc.FileStructure.IncrementalUpdate = True
'Create a new page
lDoc.Pages.Add()
' Saves the document
lDoc.Save("FileStructure.pdf")
lDoc.Close(True)
TaggedPdf
Gets the value indicating whether the PDF document is tagged one or not.
Declaration
public bool TaggedPdf { get; }
Property Value
Type | Description |
---|---|
System.Boolean | If true PDF document is tagged, otherwise false. |
Examples
//Create a new document.
PdfDocument document = new PdfDocument();
//Set auto tag value.
document.AutoTag = true;
//Add new pdf page.
PdfPage page = document.Pages.Add();
//Initialize new instance of structure element with tag type heading.
PdfStructureElement header = new PdfStructureElement(PdfTagType.Heading);
//Initialize new instance of structure element with tag type HeadingLevel1.
PdfStructureElement header1 = new PdfStructureElement(PdfTagType.HeadingLevel1);
header1.Parent = header;
//Initialize new instance of structure element with tag type Paragraph.
PdfStructureElement structElement = new PdfStructureElement(PdfTagType.Paragraph);
structElement.Parent = header1;
//Create PDF text element.
PdfTextElement element = new PdfTextElement(@"Syncfusion Essential studio tool");
element.PdfTag = structElement;
//Set font for text element.
element.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
//Set brush for text element.
element.Brush = new PdfSolidBrush(new PdfColor(89, 89, 93));
//Draw text element into pdf page.
element.Draw(page, new RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200));
bool tagged = document.FileStructure.TaggedPdf;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new document.
Dim document As PdfDocument = New PdfDocument()
'Set auto tag value.
document.AutoTag = True
'Add new pdf page.
Dim page As PdfPage = document.Pages.Add()
'Initialize new instance of structure element with tag type heading.
Dim header As PdfStructureElement = New PdfStructureElement(PdfTagType.Heading)
'Initialize new instance of structure element with tag type HeadingLevel1.
Dim header1 As PdfStructureElement = New PdfStructureElement(PdfTagType.HeadingLevel1)
header1.Parent = header
'Initialize new instance of structure element with tag type Paragraph.
Dim structElement As PdfStructureElement = New PdfStructureElement(PdfTagType.Paragraph)
structElement.Parent = header1
'Create PDF text element.
Dim element As PdfTextElement = New PdfTextElement("Syncfusion Essential studio tool")
element.PdfTag = structElement
'Set font for text element.
element.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
'Set brush for text element.
element.Brush = New PdfSolidBrush(New PdfColor(89, 89, 93))
'Draw text element into pdf page.
element.Draw(page, New RectangleF(0, 0, page.Graphics.ClientSize.Width / 2, 200))
Dim tagged As Boolean = document.FileStructure.TaggedPdf
'Save and Close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
Version
Gets or sets the version of the PDF document.
Declaration
public PdfVersion Version { get; set; }
Property Value
Type | Description |
---|---|
PdfVersion | The document version. |
Examples
//Create a new document
PdfDocument doc = new PdfDocument();
//Create a new page
PdfPage page = doc.Pages.Add();
// Set the document`s cross reference type
doc.FileStructure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream;
// Set the PDF version
doc.FileStructure.Version = PdfVersion.Version1_6;
// Save the document
doc.Save("FileStructure.pdf");
doc.Close(true);
'Create a new document
Dim doc As New PdfDocument()
'Create a new page
Dim page As PdfPage = doc.Pages.Add()
' Set the document`s cross reference type
doc.FileStructure.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream
' Set the PDF version
doc.FileStructure.Version = PdfVersion.Version1_6
' Save the document
doc.Save("FileStructure.pdf")
doc.Close(True)
Methods
OnTaggedPdfChanged(EventArgs)
Create the OnPropertyChanged method to raise the event
Declaration
protected void OnTaggedPdfChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |