PdfCompliance.PdfA1b is not working with Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions

Hi,

I am trying to generate a PDFA1B compliant PDF file from an existing xlsx file using below mentioned Example-1 code. 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”.

This blue bar with information is NOT appearing on the top of the PDF with Example-1 Code. How ever it is able to show the blue bar with the mentioned info with Example-2 Code.

So could you please let me know why PdfCompliance.PdfA1b is not working Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions as mentioned in the Example-1?

====================================================

Example 1: ( with Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions )

==================================================

//Instantiate new workbook
Workbook workbook = new Workbook(filename);

PdfSaveOptions saveOption = new PdfSaveOptions();

//Set the compliance type
saveOption.Compliance = PdfCompliance.PdfA1b;
saveOption.SecurityOptions = new Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions();
saveOption.SecurityOptions.OwnerPassword = “”;
saveOption.SecurityOptions.UserPassword = “”;
saveOption.SecurityOptions.PrintPermission = true;
saveOption.SecurityOptions.FullQualityPrintPermission = true;
saveOption.SecurityOptions.ExtractContentPermission = true;

String outputFileName = filename.Replace(".xlsx", “.pdf”);
//Save the file
workbook.Save(outputFileName, saveOption);

====================================================

Example 2: (Without Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions)

==================================================

//Instantiate new workbook
Workbook workbook = new Workbook(filename);

PdfSaveOptions saveOption = new PdfSaveOptions();

//Set the compliance type
saveOption.Compliance = PdfCompliance.PdfA1b;

String outputFileName = filename.Replace(".xlsx", “.pdf”);

//Save the file
workbook.Save(outputFileName, saveOption);

Regards,

Sudhakar S.

Hi,


Thanks for providing us sample codes and details.

After an initial test, I can find the issue. You are right, the PdfCompliance.PdfA1b is not working with Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions, but when we do not use Aspose.Cells.Rendering.PdfSecurity options, it works and generates valid PDF/A file. I use any sample XLSX file for an input file. I have logged a ticket with an id “CELLSNET-41778” for your issue. We will look into it soon.


Sample code:


Example 1: ( with Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions )

==================================================

//Instantiate new workbook
Workbook workbook = new Workbook(filename);

PdfSaveOptions saveOption = new PdfSaveOptions();

//Set the compliance type
saveOption.Compliance = PdfCompliance.PdfA1b;
saveOption.SecurityOptions = new Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions();
saveOption.SecurityOptions.OwnerPassword = “”;
saveOption.SecurityOptions.UserPassword = “”;
saveOption.SecurityOptions.PrintPermission = true;
saveOption.SecurityOptions.FullQualityPrintPermission = true;
saveOption.SecurityOptions.ExtractContentPermission = true;



String outputFileName = filename.Replace(".xlsx", “.pdf”);
//Save the file
workbook.Save(outputFileName, saveOption);

Once we have any update on it, we will let you know here.

Thank you.

Is it possible to you guys to fix this issue quickly. We have some urgent requirements on this? Can you please let me know the ETA for this?

Regards,

Sudhakar S.

At least if you can provide me a workaround for this issue. That would be a great help for me.

Regards,

Sudhakar S.

Hi,


Please spare us some time (2,3 days) as we have to analyze the issue first. Our developer will investigate your issue soon. If the issue is not complex, we normally can fix it with 2-5 days, if it is a complex issue, we might fix it in weeks or more.

Once we figure it out or have some other update or workaround, we will let you know here.


Thanks for your understanding!

Thank you for the quick reply. I have few more questions.

1) We are currently using 7.1.0.0 version of Aspose.cells.

What is the latest version of Aspose.cells? By any chance, is this fix available in latest Aspose.cells? Or still need to be fixed in the latest version also?

2) If you still need to fix this issue in the latest version,

If I upgrade my application to the latest version of Aspose.Cells which includes fix for this issue, what are the areas that it can break? I mean, what could be the impact of applications? If you have suggestions on this, please share.

3)If I use Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions,

I would like to know whether code(Example-1) is not at all converting the xls to PDFA1B compliant PDF document or this code is converting to PDFA1B compliance PDF, but not able to show the blue bar with compliance information.

Please confirm what is the exact root cause for this issue after your analysis.

Regards,

Sudhakar S.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have checked your issue with the latest version but it is not yet fixed in the latest version. Once, it is fixed, we will let you know asap.

Hi,

I'm curious to know details about my 3rd question. Could you please provide more details on that?

"3)If I use Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions,

I would like to know whether code(Example-1) is not at all converting the xls to PDFA1B compliant PDF document or this code is converting to PDFA1B compliance PDF, but not able to show the blue bar with compliance information."

Regards,

Sudhakar S.

Hi,


For your queries.

1) Our latest version of Aspose.Cells is v7.5.0 and the fixes are provided or enhancements are added/included in the latest version of the product only. We cannot add or include functionality/fixes in the older versions of the product.

2) There is not any significant changes/issues that you have to cope with when you upgrade from your older version i.e..v7.1.0 to latest v7.5.0.x or so. There would be no impact on your existing applications.

3) We have to analyze it thoroughly first if this is an issue, limitation or something else. We will do it soon. Hopefully we will get back to you soon.

Thank you.

Hi,

Thanks for your posting and using Aspose.Cells.

We have looked into your issue and after investigation, we found that PDFA1B does not support encryption as mentioned in this link.

http://en.wikipedia.org/wiki/PDF/A

When, I use Aspose.pdf document to convert it to PDFA1B compliant after generating the PDF document with Security settings (password set) using Aspose.cells, then the generated PDF document is able to show the PDFA compliance blue bar and it is able to retain the security settings. Could you please let me know your thoughts on this? Why Aspose.pdf is able to do this, and Aspose.Cells is not able to do ? Please elaborate the details.

Just to re-iterate, it is able to show the blue bar of PDFA compliance and also setting up the Security Settings.

Below is program

//Instantiate new workbook
Workbook workbook = new Workbook(filename);

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

saveOption.SecurityOptions = new Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions();
saveOption.SecurityOptions.OwnerPassword = "";
saveOption.SecurityOptions.UserPassword = "";
saveOption.SecurityOptions.PrintPermission = true;
saveOption.SecurityOptions.FullQualityPrintPermission = true;
saveOption.SecurityOptions.ExtractContentPermission = true;

String outputFileName = filename.Replace(".xlsx", ".pdf");

////Save the file
workbook.Save(outputFileName, saveOption);


Document pdfDocument = new Document(outputFileName);

////Convert to PDF/A compliant document
////during conversion process, the validation is also performed
pdfDocument.Convert("log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

////save output document
pdfDocument.Save(outputFileName);

Another thing is that I just created the PdfSecurityOptions class object and did not initialize any property of this object and tried to save with compliance 1b option. Still it is not able to generate the 1b compliance pdf. Does that mean, it is doing some encryption as soon as create the object of this class?

Sample code;

//Instantiate new workbook
Workbook workbook = new Workbook(filename);

PdfSaveOptions saveOption = new PdfSaveOptions();

//Set the compliance type
saveOption.Compliance = PdfCompliance.PdfA1b;
saveOption.SecurityOptions = new Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions();

String outputFileName = filename.Replace(".xlsx", ".pdf");
//Save the file
workbook.Save(outputFileName, saveOption);

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

This is not the bug of Aspose.Cells. PDFA1B does not support encryption as mentioned in this link.

http://en.wikipedia.org/wiki/PDF/A

So, we also cannot support it.