PDF-A creation

Hi,

I have Aspose Total license, i want to create PDF-A as below
1. Saving existing PDF as PDF-A for long term archival
2. Directly saving content as PDFA.

Are these possible using Aspose?
I heard that PDFA component is in Beta…is this true? If so cant i rely on it?

Thanks,
Sanjeev

HI**,**

Need help in creating PDF-A using Aspose PDF Kit of PDF. Is it possible?

Do i have any constraints in creating fully compliant PDF-A file?

Is it fully compliant?

Any idea when this can be released?

ursanju:
Hi,

I have Aspose Total license, i want to create PDF-A as below
1. Saving existing PDF as PDF-A for long term archival
Thanks for using our products.
We have a component named Aspose.Pdf.Kit which is used to edit/manipulate the existing PDF documents. I am afraid the feature of converting existing PDF documents into PDF-A is currently not supported. However, this requirement is already logged in our issue tracking system as PDFKITNET-10208. Our development team is working over this requirement and as soon as the feature becomes available, you will be updated with in this forum thread. Please be patient and spare us little time. We apologize for your inconvenience.
ursanju:
2. Directly saving content as PDFA.

Are these possible using Aspose?
I heard that PDFA component is in Beta..is this true? If so cant i rely on it?

Thanks,
Sanjeev

We have a component named Aspose.Pdf, which is used to generate PDF documents from scratch. From your above question, if you need to generate a new PDF file and want to save it as PDF-A, then I am pleased to inform you that this feature is supported by Aspose.Pdf. For further information, please visit How to create PDF/A-1 with Aspose.Pdf

This feature is not in Beta phase. Please try using it and in case you encounter any problem, please feel free to contact.

We have used two methods for converting pdf to pdfcompliant which are mentioned below, but both are failed.

Method 1:

</span><span lang="EN-US" style="font-size:9.5pt;font-family:

Consolas;mso-ansi-language:EN-US">Aspose.Pdf.License
lic = new Aspose.Pdf.License();<o:p></o:p>

lic.SetLicense("Aspose.Total.lic");

Pdf objPDF = new Pdf();

//Set the conformance property of Pdf class to predefined value

objPDF.Conformance = PdfConformance.PdfA1A;

//Add a section into the pdf document

Aspose.Pdf.Section section = objPDF.Sections.Add();

//Save the document

objPDF.Save(@"C:\pdfcompliant.pdf");

Result: PDF File save like a Blank Page.

Method 2:

Aspose.Pdf.License lic = new Aspose.Pdf.License();

lic.SetLicense("Aspose.Total.lic");

Pdf objPDF = new Pdf();

//Set the conformance property of Pdf class to predefined value

objPDF.Conformance = PdfConformance.PdfA1A;

//Add a section into the pdf document

Aspose.Pdf.Section section = objPDF.Sections.Add();

//Create an image object in the section

Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);

//Add image object into the Paragraphs collection of the section

section.Paragraphs.Add(image);

//Set the stream of image file

image.ImageInfo.ImageStream = imageStream;

//Save the document

objPDF.Save(@"C:\pdfcompliant.pdf");

Result: Error: Parameter is not valid

ursanju:

We have used two methods for converting pdf to pdfcompliant which are mentioned below, but both are failed.<?xml:namespace prefix = o />

Method 1:

Aspose.Pdf.License lic = new Aspose.Pdf.License();

lic.SetLicense("Aspose.Total.lic");

Pdf objPDF = new Pdf();

//Set the conformance property of Pdf class to predefined value

objPDF.Conformance = PdfConformance.PdfA1A;

//Add a section into the pdf document

Aspose.Pdf.Section section = objPDF.Sections.Add();

//Save the document
objPDF.Save(@"C:\pdfcompliant.pdf");

Result: PDF File save like a Blank Page.

Hi,

Thanks for sharing the code snippet. You are getting a blank PDF because you have not placed any paragraph object (Text, Image, Table, Graph, Attachment) inside PDF section. Please add the following code lines to add a text paragraph to resultant PDF.

[C#]

// create text paragraph
Text sampletext = new Text("Hello World");
// add text paragraph to paragraphs collection of Pdf document
section.Paragraphs.Add(sampletext);

ursanju:

Method 2:

Aspose.Pdf.License lic = new Aspose.Pdf.License();
lic.SetLicense("Aspose.Total.lic");

Pdf objPDF = new Pdf();
//Set the conformance property of Pdf class to predefined value
objPDF.Conformance = PdfConformance.PdfA1A;

//Add a section into the pdf document
Aspose.Pdf.Section section = objPDF.Sections.Add();

//Create an image object in the section
Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);

//Add image object into the Paragraphs collection of the section
section.Paragraphs.Add(image);

//Set the stream of image file
image.ImageInfo.ImageStream = imageStream;

//Save the document
objPDF.Save(@"C:\pdfcompliant.pdf");

Result: Error: Parameter is not valid

I have tested the scenario using following code snippet with Aspose.Pdf for .NET 4.8.0 and I am unable to notice any problem. Can you please make sure that the source Stream is in correct format. However, I have used the following code snippet and the PDF document is properly being generated. I have also attached the resultant PDF that I have generated. We are sorry for your inconvenience.

[C#]

// create a FileStream object for image file
FileStream fs = new FileStream(@"d:/pdftest/Penguins.jpg", FileMode.Open);
Pdf objPDF = new Pdf();
//Set the conformance property of Pdf class to predefined value
objPDF.Conformance = PdfConformance.PdfA1A;
//Add a section into the pdf document
Aspose.Pdf.Section section = objPDF.Sections.Add();

//Create an image object in the section
Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);
//Add image object into the Paragraphs collection of the section
section.Paragraphs.Add(image);
//Set the stream of image file
image.ImageInfo.ImageStream = fs;
//Save the document
objPDF.Save(@"d:/pdftest/pdfcompliant.pdf");
fs.Close();

Thank you for your response.

But our problem is not solved.
Here is the exact description of our problem with 2 scenarios

1)PDF Document to PDF
compliant
:<o:p></o:p>

As per our requirement we need to convert pdf document(remember.. existing PDF file) to pdfacompliant for that we have used below method which is not working.

//create a FileStream object for Pdf file

FileStream fs = new FileStream(@"C:\PdfTestFile.Pdf", FileMode.Open);

Pdf objPDF = new Pdf();

//Set the conformance property of Pdf class to predefined value

objPDF.Conformance = PdfConformance.PdfA1A;

//Add a section into the pdf document

Aspose.Pdf.Section section = objPDF1.Sections.Add();

//Create an image object in the section

Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);

//Add image object into the Paragraphs collection of the section

section.Paragraphs.Add(image);

//Set the stream of pdf file

image.ImageInfo.ImageStream = fs;

//Save the document

objPDF.Save(@"C:\pdfcomplianttest.pdf");

fs.Close ();

Result:
Error: Parameter is not valid<o:p></o:p>

2)PDF Document page to Image(bmp,jpeg):

Converting
Pdf page to image(bmp,jpeg) for that we have used below method, which not
working for all the pdf files,It gives blank page or symbols or images .<o:p></o:p>

It does not extracting text.

byte [] yFullImage = null;

Aspose.Pdf.Kit.License lic = new Aspose.Pdf.Kit.License();

lic.SetLicense("Aspose.Total.lic");

//Create File Editor object

PdfFileEditor pdfEditor = new PdfFileEditor();

//Create file pdf stream object

using (FileStream inputStream = new FileStream(C:\PDFDocument.pdf", FileMode.Open))

{

using (MemoryStream msOutStream = new MemoryStream())

{

//Extract Pdf page from pdf file and assign to MemoryStream Object

bool bsuccess = pdfEditor.Extract(inputStream, 1, 1, msOutStream);

// Create converter object for converting pdf page to jpeg

PdfConverter pdfConverter = new PdfConverter();

pdfConverter.BindPdf(msOutStream);

pdfConverter.DoConvert();

if(pdfConverter.HasNextImage())

{

using (MemoryStream msOutPutImage = new MemoryStream())

{

pdfConverter.GetNextImage(msOutPutImage,System.Drawing.Imaging.ImageFormat.Jpeg);

//Memory stream converting byte array

yFullImage = msOutPutImage.ToArray();

msOutStream.Close();

}

}

pdfConverter.Close();

}

}

Result: white page/ some symbols/some images ……… Totally fail to extracting text.

ursanju:
Thank you for your response.
But our problem is not solved.
Here is the exact description of our problem with 2 scenarios

1)PDF Document to PDF compliant :<?xml:namespace prefix = o />

As per our requirement we need to convert pdf document(remember.. existing PDF file) to pdfacompliant for that we have used below method which is not working.

//create a FileStream object for Pdf file

FileStream fs = new FileStream(@"C:\PdfTestFile.Pdf", FileMode.Open);

Pdf objPDF = new Pdf();

//Set the conformance property of Pdf class to predefined value

objPDF.Conformance = PdfConformance.PdfA1A;

//Add a section into the pdf document

Aspose.Pdf.Section section = objPDF1.Sections.Add();

//Create an image object in the section

Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);

//Add image object into the Paragraphs collection of the section

section.Paragraphs.Add(image);

//Set the stream of pdf file

image.ImageInfo.ImageStream = fs;

//Save the document

objPDF.Save(@"C:\pdfcomplianttest.pdf");

fs.Close ();

Result: Error: Parameter is not valid

Hi,

Thanks for the information and the code snippet. Aspose.Pdf is a component which offers the capability to generate PDF documents from scratch. However, in order to edit/manipulate existing PDF documents, you need to try using Aspose.Pdf.Kit which provides the feature of working with existing PDF files. As per your requirement on converting existing PDF file into PDF-A compliant format, I am afraid this feature is currently not supported. However, for the sake of correction, this requirement has already been logged in our issue tracking system as PDFKIENET-10208. Our development team is working over this requirement and once we have some definite news regarding its resolution, we would be pleased to update you with the status of correction. We apologize for your inconvenience.

ursanju:

2)PDF Document page to Image(bmp,jpeg):

Converting Pdf page to image(bmp,jpeg) for that we have used below method, which not working for all the pdf files,It gives blank page or symbols or images .

It does not extracting text.

byte [] yFullImage = null;

Aspose.Pdf.Kit.License lic = new Aspose.Pdf.Kit.License();

lic.SetLicense("Aspose.Total.lic");

//Create File Editor object

PdfFileEditor pdfEditor = new PdfFileEditor();

//Create file pdf stream object

using (FileStream inputStream = new FileStream(C:\PDFDocument.pdf", FileMode.Open))

{

using (MemoryStream msOutStream = new MemoryStream())

{

//Extract Pdf page from pdf file and assign to MemoryStream Object

bool bsuccess = pdfEditor.Extract(inputStream, 1, 1, msOutStream);

// Create converter object for converting pdf page to jpeg

PdfConverter pdfConverter = new PdfConverter();

pdfConverter.BindPdf(msOutStream);

pdfConverter.DoConvert();

if(pdfConverter.HasNextImage())

{

using (MemoryStream msOutPutImage = new MemoryStream())

{

pdfConverter.GetNextImage(msOutPutImage,System.Drawing.Imaging.ImageFormat.Jpeg);

//Memory stream converting byte array

yFullImage = msOutPutImage.ToArray();

msOutStream.Close();

}

}

pdfConverter.Close();

}

}

Result: white page/ some symbols/some images ……… Totally fail to extracting text.

For this particular issue, I have asked my fellow colleague to look into the details of this matter and soon you will be updated with the status of correction. However, I would request you to please share the source PDF document that is causing an issue so that we can test the scenario at our end. We are sorry for the delay and inconvenience.

Hi Sanjeev,

First off, please download the latest version of Aspose.Pdf.Kit for .NET and try the PDF to image conversion with that. If it doesn’t resolve your issue then please share the input PDF file (PDFDocument.pdf) with us, so we could test the issue at our end. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,

Hi,
The problem(Pdf page to Image) not resolved with Latest Version of Aspose.Pdf.Kit(5.0.0.1 Date:8th Dec 2010) , here attached pdf documents please look into it.


Thanks,
Sanjeev

Hi Sanjeev,

I have tested this issue using your sample files with the latest version but could not reproduce this problem. I would like to share that the latest version is Aspose.Pdf.Kit for .NET 5.1.0. You may download it from this link. If you still find the same issue at your end then please share some more details regarding your working environment i.e. OS, .NET version etc.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,

codewarior:
Thanks for using our products.
We have a component named Aspose.Pdf.Kit which is used to edit/manipulate the existing PDF documents. I am afraid the feature of converting existing PDF documents into PDF-A is currently not supported. However, this requirement is already logged in our issue tracking system as PDFKITNET-10208. Our development team is working over this requirement and as soon as the feature becomes available, you will be updated with in this forum thread. Please be patient and spare us little time. We apologize for your inconvenience.



Hello,

We have a Aspose Total License and we need the PDF to PDF/A conversion feature. Can you inform me on the status of this issue PDFKITNET-10208?

We need this feature very soon (within a week), so if this feature is not available yet, maybe there is a beta version we can test?

Thanks in advance.

Hi Vincent,

I’m sorry to inform you that this feature is not supported yet. Our team is working on this feature and it is expected at the end of June or early July 2011. I’m afraid, it is not feasible for us to provide this feature in a week or so. Please spare us some time for the implementation and testing of this feature. You’ll be notified via this forum thread once it is supported.

We’re sorry for the inconvenience and appreciate your cooperation.
Regards,

Hi shahzad.latif,

Are any updates about PDF to PDF/A conversion? Is release of this feature still scheduled on June/July of 2011 year?

Best regards,
Alex Shloma

Hi Alex,

Yes, this release is still scheduled for early July 2011. I hope this helps. If you have any further questions, please do let us know.

Regards,


The issues you have found earlier (filed as PDFNEWNET-10208;PDFNEWNET-10208;PDFNEWNET-10208) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(15)