Search code examples
c#pdfanetoffice

Create a PDF/A file with NetOffice


I create my PDF file with:

ExportAsFixedFormat(pdffilename, WdExportFormat.wdExportFormatPDF);

but i need a PDF/A PDF. Is there a way to get this done with NetOffice?


Solution

  • Use Document.ExportAsFixedFormat overload with useISO19005_1 parameter.

    newDocument.ExportAsFixedFormat(pdfFilename, WdExportFormat.wdExportFormatPDF,
      false, WdExportOptimizeFor.wdExportOptimizeForPrint,
      WdExportRange.wdExportAllDocument, 0, 0,
      WdExportItem.wdExportDocumentContent, true, false,
      WdExportCreateBookmarks.wdExportCreateNoBookmarks, true, true,
      useISO19005_1: true);