David Černý
unread,May 14, 2013, 7:54:47 PM5/14/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message as abuse
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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";
PDFNet.Initialize();
//create PDF with attachment
using (var doc = new PDFDoc())
{
doc.PagePushBack(doc.PageCreate());
doc.AddFileAttachment(attachment_file_name, FileSpec.Create(doc.GetSDFDoc(), input_path + attachment_file_name,true));
doc.Save(pdf_file_name,0);
}
//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.