PdfDocument Constructor(String,PdfFormat)
Initializes a new instance of the
PdfDocument class.
This constructor creates new PDF document in read-write mode.
Here is an example that shows how to create an empty PDF/A document version 1.4 in a file:
Public Shared Sub CreatePdfADocumentInFile(pdfFilename As String, pageImage As String)
' create new PDF document version 1.4
Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename, Vintasoft.Imaging.Pdf.PdfFormat.Pdf_14)
' create an image
Using image As New Vintasoft.Imaging.VintasoftImage(pageImage)
' add image to PDF document
document.Pages.Add(image)
End Using
' convert documen to PDF/A-1b
document.ConvertDocument(Vintasoft.Imaging.Pdf.PdfDocumentConformance.PdfA_1b)
End Using
End Sub
public static void CreatePdfADocumentInFile(string pdfFilename, string pageImage)
{
// create new PDF document version 1.4
using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(
pdfFilename, Vintasoft.Imaging.Pdf.PdfFormat.Pdf_14))
{
// create an image
using (Vintasoft.Imaging.VintasoftImage image = new Vintasoft.Imaging.VintasoftImage(pageImage))
{
// add image to PDF document
document.Pages.Add(image);
}
// convert documen to PDF/A-1b
document.ConvertDocument(Vintasoft.Imaging.Pdf.PdfDocumentConformance.PdfA_1b);
}
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5