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

Free Support Forum - aspose.com

Convert PDF/A to standard PDF document

Hi Support team,
I tried using below code for converting PDF/A doc to PDF.
Document document = new Document(@“D:\IBM\Issues\Data\Aspose\Legal-Formal-Complaint-Letter-Template-PDF-Printable\PDFSampleSecure.pdf”); document.RemovePdfaCompliance();
document.Save(@“D:\IBM\Issues\Data\Aspose\Legal-Formal-Complaint-Letter-Template-PDF-Printable” + “ProtectDocument Vision v1 - PDFA-1b_Standard.pdf”);

The converted PDF still have all the restrictions as same as PDF/A .
I have attached the snapshot of the restrictions after removingPdfaComplaince.

I am also attaching sample PDF/A format.PDF_Standard.png (51.5 KB)

PDFSampleSecure.pdf (85.4 KB)

Please let me know, how can I remove the secure restrictions as shown in PDF_Standard.png
Thanks,
Hemalatha

@hebharad

Thanks for contacting support.

The shared document has privileges set. Please use following code snippet to remove restrictions:

Facades.PdfFileSecurity fs = new Facades.PdfFileSecurity();
fs.BindPdf(dataDir + "PDFSampleSecure.pdf");
Facades.DocumentPrivilege dp = Facades.DocumentPrivilege.AllowAll;
fs.SetPrivilege(dp);
fs.Save(dataDir + "RestrictionsRemoved.pdf");  

RestrictionsRemoved.pdf (37.6 KB)

In case of further assistance, please feel free to contact us.

Hi,

I think I need to call close and dispose and the end when restrictions are removed or there is no need to call Dispose?
try
{
Facades.PdfFileSecurity fs = new Facades.PdfFileSecurity();
fs.BindPdf(dataDir + “PDFSampleSecure.pdf”);
Facades.DocumentPrivilege dp = Facades.DocumentPrivilege.AllowAll;
fs.SetPrivilege(dp);
fs.Save(dataDir + “RestrictionsRemoved.pdf”);
}
catch()
{
}
finally
{
fs,close();
fs.Dispose();
}

@hebharad

Thanks for getting back to us.

Please note that calling Save() method is more like disposing the object as it clears all resources from memory which were being used during PDF generation or modifications scenarios. However, it is not certain in all cases depending upon how much resources are loaded into memory or how complex is the scenario. Nevertheless, there is no harm in using Dispose or Close methods as they help reducing memory consumption. Please feel free to let us know in case of any further query.

Hi,
In the PDF generated I can see watermark on top saying “Evaluation Only. Created with Aspose.PDF. Copyright 2002-2018 Aspose Pty Ltd.”

Can you please help me what am I missing if its with license?

@hebharad

Thanks for getting back to us.

Yes, the evaluation watermark is displayed due to limitation of trial version. In order to prevent this watermark and evaluate API without any limitation, please use a valid license. In case you do not have one, you can apply for a free 30-days temporary license over our website.

I already have license for Aspose.word, aspose.html, aspose.total, aspose.cell do we need to separately take license for aspose.PDF?

Can you please let me know how should I apply the license?

@hebharad

Thanks for writing back.

In case you have license of Aspose.Total, you may use it for Aspose.PDF as well. While using multiple Aspose APIs in your environment, you need to set license for each API separately. For more information regarding license settings, please visit following article(s) in our API documentation:

In case of any further assistance, please feel free to let us know.

Hi Asad,

I have one query.

We have already some PDF 's which have watermark on top saying “Evaluation Only. Created with Aspose.PDF. Copyright 2002-2018 Aspose Pty Ltd.”
Can you let me know how can we remove watermarlk from PDF, without creating them again?
Thanks,
Hemalatha

@hebharad

You can search and remove text from PDF document using TextFragmentAbsorber Class. In case you face any issue while achieving it, please share your sample PDF. We will test the scenario in our environment and address it accordingly.

HI Asad,

Can you please elaborate on this TextFragmentAbsorber ?
Is there any other external tool through which we can remove the watermark?
Issue is Customer is using a build where PDF generated have watermark and now we had given a fix to them by adding license. The issue is they have already scanned previous PDF which have watermark. Customer is concerned how can they remove those watermark?

Thanks,
Hemalatha

@hebharad

TextFragmentAbsorber Class lets you extract text and replace it with desired value in PDF document. Nevertheless, would you please share a sample PDF document from which you want to remove the evaluation warning. We will test the scenario in our environment and address it accordingly.