Dim caption As String = "Example: PortFolioCreate"
Dim gdpicturePDF As New GdPicturePDF()
'Creating a new common PDF file.
If (gdpicturePDF.NewPDF() <> GdPictureStatus.OK) OrElse (gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeLetter) <> GdPictureStatus.OK) Then
MessageBox.Show("The new PDF document can't be created.", caption)
Else
'Embedding the files into the created PDF file.
If (gdpicturePDF.EmbedFile("textfile.txt", "1st attachmment") <> GdPictureStatus.OK) OrElse (gdpicturePDF.EmbedFile("docfile.docx", "2nd attachment") <> GdPictureStatus.OK) OrElse (gdpicturePDF.EmbedFile("pdffile.pdf", "3rd attachment") <> GdPictureStatus.OK) Then
MessageBox.Show("The files can't be attached.", caption)
Else
'Creating a PDF Portfolio.
Dim status As GdPictureStatus = gdpicturePDF.PortFolioCreate(0, PdfPortFolioType.Detail)
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("gdpicturepdf_portfolio.pdf") = GdPictureStatus.OK Then
MessageBox.Show("The PDF Portfolio file has been created and saved successfully.", caption)
End If
Else
MessageBox.Show("The PortFolioCreate() method has failed with the status: " + status.ToString(), caption)
End If
End If
End If
gdpicturePDF.Dispose()
string caption = "Example: PortFolioCreate";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
//Creating a new common PDF file.
if ((gdpicturePDF.NewPDF() != GdPictureStatus.OK) ||
(gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeLetter) != GdPictureStatus.OK))
{
MessageBox.Show("The new PDF document can't be created.", caption);
}
else
{
//Embedding the files into the created PDF file.
if ((gdpicturePDF.EmbedFile("textfile.txt", "1st attachmment") != GdPictureStatus.OK) ||
(gdpicturePDF.EmbedFile("docfile.docx", "2nd attachment") != GdPictureStatus.OK) ||
(gdpicturePDF.EmbedFile("pdffile.pdf", "3rd attachment") != GdPictureStatus.OK))
{
MessageBox.Show("The files can't be attached.", caption);
}
else
{
//Creating a PDF Portfolio.
GdPictureStatus status = gdpicturePDF.PortFolioCreate(0, PdfPortFolioType.Detail);
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("gdpicturepdf_portfolio.pdf") == GdPictureStatus.OK)
{
MessageBox.Show("The PDF Portfolio file has been created and saved successfully.", caption);
}
}
else
{
MessageBox.Show("The PortFolioCreate() method has failed with the status: " + status.ToString(), caption);
}
}
}
gdpicturePDF.Dispose();