Isn't Teranet a customer entitled to support? I've forwarded this question to our paid ticketing system. One of our support engineers will check who's our contact at your company and look into it.

On 12/11/2013 11:07 PM, Dejan Milosavljevic wrote:

Hi,

I am having some issues with PDF files generated using itext. I have attached a version of a file made in itext and another one edited in Adobe Acrobat in which I had Acrobat re-tag the document. When I use the Read-Out-Loud feature in Adobe for the one generated via itext Adobe says "Testing Testing", but when I do it in the one edited in Adobe it reads out loud the ALT text, which it should:

ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT

Interestingly enough using NVDA will read both documents correctly. Using PAC 2.0 both files have the same 4 failures, 2 related to Natural Language which is not relevant as I know how to fix that, and 2 relating to Metadata ("PDF/UA identifier missing" and "<<dc:title>> entry missing in document's XMP metadata"), these two I need to fix.

Am I doing something incorrectly?

Here's the code I used to generate the itext PDF:

// step 1

Document document = *new*Document(PageSize./LETTER/);

document.setMargins(PDFFormattingHelper./LEFT_MARGIN/, PDFFormattingHelper./RIGHT_MARGIN/,

PDFFormattingHelper./TOP_MARGIN/, PDFFormattingHelper./BOTTOM_MARGIN/);

ByteArrayOutputStream baos = *new*ByteArrayOutputStream();

PdfWriter writer = PdfWriter./getInstance/(document, baos);

writer.setViewerPreferences(PdfWriter./DisplayDocTitle/);

//set more document properties

writer.setPdfVersion(PdfWriter./VERSION_1_7/);

writer.createXmpMetadata();

writer.setTagged();

// step 3

document.open();

// step 4

BaseFont bf2 = BaseFont./createFont/("c:/windows/fonts/msgothic.ttc,1",

BaseFont./IDENTITY_H/, BaseFont./EMBEDDED/);

Paragraph p = *new*Paragraph("Testing testing", *new*Font(bf2, 11, Font./NORMAL/));

p.setAccessibleAttribute(PdfName./ACTUALTEXT/, *new*PdfString("ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT ACT "));

p.setAccessibleAttribute(PdfName./ALT/, *new*PdfString("ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT ALT "));

document.add(p);

// step 5

document.close();

        FileOutputStream fos = *new*FileOutputStream(*new*File(/RESULT/));

fos.write(baos.toByteArray());

fos.flush();

fos.close();

Thanks,

Dejan


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to