PDF/A-3a conversion with document level attachment

Skip to first unread message

David Černý

May 14, 2013, 7:54:47 PM5/14/13
to pdfne...@googlegroups.com
Hello, we are evaluating PDFNet SDK, but we have following problem:
we use this code to test PDF -> PDF/A-3a conversion:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using pdftron;
using pdftron.Common;
using pdftron.SDF;
using pdftron.PDF;
using pdftron.PDF.PDFA;

namespace _Test

    class Program

        static void Main(string[] args)
            string output_path = @"D:\!Home\TMP\";
            string input_path = @"D:\!Home\TMP\";
            string pdf_file_name = output_path + "test.pdf";
            string attachment_file_name = "sample_image.png";
            //create PDF with attachment
            using (var doc = new PDFDoc())
                doc.AddFileAttachment(attachment_file_name, FileSpec.Create(doc.GetSDFDoc(), input_path + attachment_file_name,true));
            //convert to PDF/A-3A
            using (PDFACompliance pdf_a = new PDFACompliance(true, pdf_file_name, null, PDFACompliance.Conformance.e_Level3A, null, 10, false))
                pdf_a.SaveAs(pdf_file_name + "_PDFA-3A_ByPdfNet.pdf", true);


This code finishes without any error and resulting pdf "test.pdf_PDFA-3A_ByPdfNet.pdf" is successfuly validated by Adobe Acrobat XI, but the document level attachment "sample_image.png" in "test.pdf_PDFA-3A_ByPdfNet.pdf" has unknown size and cannot be openned.
Attachment in "test.pdf" (pdf file before conversion) is ok.

Thank you for assistance.
Reply all
Reply to author
0 new messages