You may please use following code snippet, in order to edit a tagged PDF.
string value = "555";
Document doc = new Document(inFile);
Element root = doc.LogicalStructure;
TextElement el = root.Children[0] as TextElement;
el.ActualText = value;
doc.Save(outFile);
doc = new Document(outFile);
root = doc.LogicalStructure;
el = root.Children[0] as TextElement;
Assert.AreEqual(value, el.ActualText);
Please note that as tagged PDF documents have been obsoleted, so we strongly recommend to use PDF/A-1A for conversion. Please check following code snippet for mentioned conversion.
We have already logged a feature request to support generation of WCAG 2.0 compliant PDF documents, as PDFNET-39050 in our issue tracking system. I have associated the logged ticket ID with this forum thread as well, so that you will receive notification once the feature is available. As soon as we have some news on its availability, we will inform you. Please be patient and spare us little time.
Hi asad.ali
I tried to use the sample you descrived (With aspose total lic)
But unfortunately not only Aspose is not keeping the TAGS it also delete them.
If I open pdf in Acrobat Reader its marked as “Tagged PDF : No” at the document properties.
What I’m missing? Is that how aspose works? Is there a different way to keep the tags?
Would you please share your sample PDF document along with the code snippet, so that we can observe the issue in our environment and address it accordingly.
Would you please share the respective input PDF document. So that we can test the scenario in our environment and log an investigation ticket, if necessary.
We have tested the scenario with Aspose.Pdf for .NET 17.11, as it is always recommended to use latest version of the API and output PDF was still showing Tagged property as “Yes” in the document properties dialog. For your reference, we have attached the generated PDFA file in our environment.
Furthermore, we have observed that the generated PDF/A-1a document, did not pass the compliance test in Adobe Preflight tool. So we have logged an issue as PDFNET-43658 in our issue tracking system. We will further look into the details of the issue and keep you updated with the status of its resolution. Please be patient and spare us little time.
Please note that sometimes issues are used to be document specific and have only been fixed for that specific document. The issue which you have mentioned, was reported for a particular document as well as for a particular PDF format (PDF/A-1b). Since each PDF document has its own structure and complexity level so it cannot be said that same issue will be experienced with every PDF document.
We recommend to use latest version always because each new version comes with new enhancements and more fixes. Moreover, fixes against the issues, reported for older version of the API, are provided in new releases. As far as you are not experiencing any issue with your existing version of the API, you may keep using it and in case you experience any issue, which does not occur with latest version of the API, you may please upgrade your license to get latest version.
In case of any further assistance, please feel free to let us know.
Yes, your understanding is correctly. There is no known issue of Text Grable during PDF to PDF/A-1a conversion. As I stated earlier that it can be document specific and in case you face similar issue with any of your PDFs, please share the document with us. We will test the scenario in our environment and address it accordingly.
In order to generate PDF files from Word format, you need to use Aspose.Words API. In case you have accessible Word Document, you can convert it to PDF and share with us if you face any issue.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.