We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excel

Hi. I am trying to generate a PDFA1B compliant PDF file from an existing xlsx file.

But it is not able generate the PDF with PDFA1B compliance.

When I open a PDFA1B compliance PDF file with Adobe it shows up an information in blue bar saying “This file claims compliance with PDF/A standard and has been opened read-only to prevent modifications”.



if I check the file with Aspose, the result is not meeting the standard.



If I check the file with “https://www.pdf-tools.com/pdf20/en/products/pdf-converter-validation/pdf-validator/” is not correct.



If I create the file from Excel (Save as …), validation is correct.



Attachment:

- Test.xlsx : Original



- Test_A.pdf: Generated with Aspose.



- Test_A from Excel.pdf : Genenerated with Excel.





Can you help me?





Thanks in advance.

Hi Ruben,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue with your provided file using the online tool. Please also give a try to latest version: Aspose.Cells for .NET (Latest Version) and see if it makes any difference.

If your issue still occurs, then let us know your sample code. We will look into it and help you asap.

Also, Microsoft Excel does not save Excel file into PDFA1B, it only saves in PDFA1A conformance.

Hi,

Thanks for the template files.

Well, I have evaluated your scenario/ case a bit. Generally, Aspose.Cells follows Adobe specifications when rendering to PDF file format. I got the same message when opening both your files (Test_A.pdf and Test_A from Excel.pdf) into Adobe reader X:
"The file you have opened complies with the PDF/A standards and has been opened read-only to prevent modifications."

In short, we think the PDF/A file produced by Aspose.Cells APIs follows standards of Adobe.

Thank you.


Hi Shakeel.



I tried but still gives me the same problem with the new versión (8.3.2.6).



This is my code.



string strFichero = @“XXX\Test”;



string strFicheroOrigen = strFichero + “.xlsx”;



string strFicheroPDF_A = strFichero + “_A.pdf”;





Aspose.Cells.License l = new Aspose.Cells.License();

l.SetLicense(XXX\Aspose.Total.lic");





#region Save to standard PDF

//Instantiate the Workbook object

//Open an Excel file

Workbook workbook = new Workbook(strFicheroOrigen);



//Save the document in PDF format

workbook.Save(@strFicheroPDF, Aspose.Cells.SaveFormat.Pdf);

#endregion Save to standard PDF





#region Save to standard PDF_A

//Define PdfSaveOptions

Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();



//Set the compliance type

pdfSaveOptions.Compliance = PdfCompliance.PdfA1b;



//Save the file

workbook.Save(@strFicheroPDF_A, pdfSaveOptions);



#endregion Save to standard PDF_A



MessageBox.Show(“End Process”);









Thank you for your rapid response !!

Hi Amjad.



If I check the file with Aspose, the result is not meeting the starndar.



This is my validation code.



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



l.SetLicense(“Aspose.Total.lic”);



string strFichero = @“XXX\Test”;

string strFicheroPDF_A = strFichero + “_A.pdf”;

string strFicheroPDF_XML = strFichero + “_A.xml”;





//instantiate Document instance



Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(strFicheroPDF_A);



//PDF/A compliant document



Boolean complaince = pdfDocument.Validate(strFicheroPDF_XML, PdfFormat.PDF_A_1B);





if (complaince )

{

MessageBox.Show(“OK ---- PDF/A”);



}

else

{

MessageBox.Show(" ------ NO OK PDF/A -----");

};

Hi Ruben,

Thanks for your sample code and using Aspose.Cells.

We were able to observe this issue after executing your sample code with the latest version: Aspose.Cells for .NET (Latest Version) using your source Excel file. PDFA1B compliance of the output PDF was not validated as correct.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43452 - PDFA1B compliance of the output PDF was not validated as correct

I have attached the output PDFs generated by the code and screenshot showing the validation for a reference.

C#

string filePath = @“F:\Shak-Data-RW\Downloads\Test.xlsx”;


#region Save to standard PDF

//Instantiate the Workbook object

//Open an Excel file

Workbook workbook = new Workbook(filePath);


//Save the document in PDF format

workbook.Save(filePath + “.out.pdf”, Aspose.Cells.SaveFormat.Pdf);

#endregion Save to standard PDF



#region Save to standard PDF_A

//Define PdfSaveOptions

Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();


//Set the compliance type

pdfSaveOptions.Compliance = PdfCompliance.PdfA1b;


//Save the file

workbook.Save(filePath + “.outA1b.pdf”, pdfSaveOptions);


#endregion Save to standard PDF_A



OK.

Thanks.

Hi,


I have further evaluated your issue with both Aspose.Pdf and online tool to validate the document. I observed the issue as you mentioned. I generated the PDF/A
file from your template Excel file “Test.xlsx” via Aspose.Cells APIs. Now I
use both Aspose.Pdf component and the online tool (“https://www.pdf-tools.com/pdf20/en/products/pdf-converter-validation/pdf-validator/”)
to validate the output PDF/A file but both fail to valid the document.
I used the following sample code to process the output PDF/A file(by
Aspose.Cells API). I am using latest version of Aspose.Pdf v10.1.0:

e.g

Sample code:


Aspose.Pdf.PdfSaveOptions saveOptions = new Aspose.Pdf.PdfSaveOptions();

Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document("e:\\test2\\outTest1.pdf");

//PDF/A compliant document

Boolean complaince = pdfDocument.Validate("e:\\test2\\outTest1.xml", Aspose.Pdf.PdfFormat.PDF_A_1B);


if (complaince)
{
Console.WriteLine("OK ---- PDF/A");

}
else
{
Console.WriteLine(" ------ NO OK PDF/A -----"); //This line is processed as the Boolean variable is false.
}

I have logged a ticket with an id "CELLSNET-43454" for your issue. We will look into it to figure it out soon.

Thank you.

OK Amjad.

Thanks.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET (Latest Version) and let us know your feedback.

Hi Shakeel.

I had tried the latest version and works properly.
Does the new version will be published soon? Can I use it?.

Thank you very much for your quick response.

Hi,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with the latest version. Yes, you can use this version for your production use. Also, we will publish a major official version 8.4.0 in few days. Most probably, this coming Friday and it will also include this fix. Once, it will be released, you will get an automatic notification of it in this thread.

Ok.

Thanks.

The issues you have found earlier (filed as CELLSNET-43454;CELLSNET-43452) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.