You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,7 +11,9 @@ PDF Portfolios allows the user to bring together content from a variety of sourc
11
11
12
12
## Creating a PDF portfolio
13
13
14
-
You can create a portfolio using [PdfPortfolioInformation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.PdfPortfolioInformation.html) class and attach a variety of documents using [PdfAttachment](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Interactive.PdfAttachment.html) class. The following code example illustrates this.
14
+
A PDF portfolio enables the embedding of multiple files within a single PDF container, with each file represented as a **PdfAttachment**. Attachments can include metadata such as file name, description, creation and modification dates, MIME type, and a relationship type. Use the [PdfAttachment](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Interactive.PdfAttachment.html) class to define each embedded file, while portfolio behavior such as specifying a startup document is configured through the documents [PdfPortfolioInformation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.PdfPortfolioInformation.html).
15
+
16
+
The following code example illustrates this.
15
17
16
18
{% tabs %}
17
19
@@ -28,11 +30,23 @@ document.PortfolioInformation = new PdfPortfolioInformation();
'Add the attachment to the document's attachment collection
95
136
document.Attachments.Add(pdfFile)
96
137
97
138
'Save and close the document.
@@ -106,7 +147,9 @@ You can download a complete working sample from [GitHub](https://github.com/Sync
106
147
107
148
## Extracting file from PDF Portfolio
108
149
109
-
The Essential<sup>®</sup> PDF provides support for extracting the files from the PDF Portfolio using [Attachments](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Parsing.PdfLoadedDocument.html#Syncfusion_Pdf_Parsing_PdfLoadedDocument_Attachments) property of [PdfLoadedDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Parsing.PdfLoadedDocument.html) class and saving the files to the disk. The following code sample shows the steps to extract files from PDF Portfolio.
150
+
Files embedded in a PDF portfolio can be extracted using the [Attachments](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Parsing.PdfLoadedDocument.html#Syncfusion_Pdf_Parsing_PdfLoadedDocument_Attachments) property of the [PdfLoadedDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Parsing.PdfLoadedDocument.html) class. Each attachment can be accessed, read, and saved to disk. Metadata such as file name and MIME type can also be retrieved during the extraction process.
151
+
152
+
The following code demonstrates how to iterate through the attachments in a PDF portfolio.
110
153
111
154
{% tabs %}
112
155
@@ -118,15 +161,28 @@ using Syncfusion.Pdf.Parsing;
118
161
//Load an existing PDF document
119
162
PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
120
163
121
-
//Iterate the attachments
164
+
//Iterate through all attachments in the PDF document
122
165
foreach (PdfAttachment attachment in document.Attachments)
123
166
{
124
-
//Extract the attachment and save to the disk
125
-
FileStream s = new FileStream(attachment.FileName, FileMode.Create);
0 commit comments