Create Accessible PDF files/Tagged PDFs/ADA compliant PDFs using Aspose.PDF for .NET

Hi
Thank you for your quick reply

I attached the Word document that I want to convert to PDF/UA format

I used the following code (aspose total version 19.4);

        Aspose.Words.Document wordDocument = null;
        string inputFile = "2.doc";
        string outputfile = "2PDF_UA.pdf";

        try
        {
            Aspose.Words.License license = new Aspose.Words.License();
            license.SetLicense("Aspose.Total.lic");

            wordDocument = new Aspose.Words.Document(inputFile);
        }
        catch (Exception ex)
        {
            Console.WriteLine("Can’t find pdf file");
            Console.ReadKey();
            return;
        }

        wordDocument.Save(outputfile);


        Aspose.Pdf.Document pdfDocument = null;
        pdfDocument = new Aspose.Pdf.Document(outputfile);

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

        pdfDocument.Validate("validate.xml", PdfFormat.PDF_UA_1);

        pdfDocument.Convert("file.log", PdfFormat.PDF_UA_1, ConvertErrorAction.Delete);
        pdfDocument.Save(outputfile);

        Console.ReadKey();

The main purpose is to see that the PDF document created is a Tagged PDF (PDF/UA and WCAG Compliance)

2.zip (19.8 KB)

(if you can share a code it will be the best :slight_smile: )

Thank you for your help
Yaron,

@yaronz

We are looking into the scenario and will get back to you shortly.

Hi,

Is there an answer for this issue?
we are using the 30 days licence and it about to over, I will not be able to test it again.

Thanks
Yaron

@yaronz

Sorry for the delayed response.

We have tested the scenario in our environment and observed that output PDF/UA_1 document did not pass compliance test. Please check following code snippet which was used for testing:

Aspose.Words.Document doc = new Words.Document(dataDir + "2.doc");
Aspose.Words.Saving.PdfSaveOptions saveOption = new Words.Saving.PdfSaveOptions();
saveOption.SaveFormat = Words.SaveFormat.Pdf;
doc.Save(dataDir + "2.pdf", saveOption);
Document document = new Document(dataDir + "2.pdf");
document.Convert(dataDir + "file.log", PdfFormat.PDF_UA_1, ConvertErrorAction.Delete);
document.Save(dataDir + "Converted.pdf");
// Call this method to check if output validates the applied compliance
bool isValid = document.Validate("file.log", PdfFormat.PDF_UA_1)

In above code snippet, you can use Validate() method to determine if output document is PDF/UA compliant or not after converting the document. Furthermore, for observed issue, we have logged it as PDFNET-46429 in our issue tracking system. You can further see the compliance error in attached screenshot. We will definitely let you know as soon as logged issues are resolved. Please spare us little time.

We are sorry for the inconvenience.
2019-05-22_19-37-31.png (48.7 KB)

Hi,
Is there any news about PDFNET-46429?

Thank you,
Yaron

@yaronz

Regretfully the earlier logged ticket is not resolved due to low priority. We will surely inform you as soon as we have some certain updates regarding its resolution. Please spare us some time.

We are sorry for the inconvenience.

Hi,

is there a road map for creating PDF/UA compliant tagged documents?

Thanks

@yaronz

Creating PDF/UA compliant documents is already supported in API. However, the ticket which was logged for non-compliance test results of output PDF, is currently not resolved. We are afraid that its investigation is not yet completed. As soon as it is done, we will inform you about its ETA or resolution. Please spare us some time.

We are sorry for the inconvenience.

Thank you for your response
Can you please direct me to the documentation and share some code?
And does the output of the conversion pass compliance test?

Thanks

@yaronz

You may please check working with Tagged PDFs article(s) in our API Documentation. We have tested with our sample files and did not notice any issue during compliance test. However, if you notice any with your PDF, please share it with us. We will test the scenario in our environment and address it accordingly.

But I don’t want to create the tags
I want to keep tags from word document.
as mentioned earlier in out conversation.
and I can’t see information about it.
is it available?

@yaronz

That of your requirements have already been logged under the ticket ID PDFNET-46429 which is not yet resolved. We will surely inform you as soon as the ticket is fully investigated and fixed. Please have patience and give us some time.

We are sorry for the inconvenience.

1 Like

we are trying to convert HTML to PDF and we are using Convert method with format(PDF_UA_1), still pdf are not ADA compliant

@testinghtmltopdf

Could you please share your sample HTML file in .zip format with us. Also, please share the sample code snippet that you are using. We will test the scenario in our environment and address it accordingly.

you can take any sample html with some text
and we have code as below
HtmlLoadOptions lp= new HtmlLoadOptions(HTML File);
Document d= new Document(HTML File, lp);
d.Convert(html file, PdfFormat.PDF_A_1B,ConvertErrorAction.None);
d.Save(convertedfilename);

tried PDF_UA_1 format too, but same results as above

@testinghtmltopdf

A similar issue has already been logged in our issue tracking system for the scenario. The ticket ID is PDFNET-47523 and it has been linked to this forum thread as well. We will inform you as soon as the ticket is resolved. Please give us some time.

We are sorry for the inconvenience.

is this issue resolved?

@testinghtmltopdf

At present the issue is still unresolved. We request for your patience and will share feedback with you as soon as the issue will be fixed.

Is this issue solved?