Welcome Guest Search | Active Topics | Sign In | Register

Setting HtmlToPdfOptions.HeaderHtmlFormat impacts screen reader Options
Phil
Posted: Friday, March 28, 2025 8:13:00 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 73
Hello, I have generated a PDF with the latest version of EO-PDF (25.1.22, GenerateTags=true), using NVDA to screen reader the PDF, and using Acrobat Reader to view the PDF - without specifying the HeaderHtmlFormat the PDF honors NVDA shortcut keys such as (h)eading, (t)able, etc but when HeaderHtmlFormat is set as per below the shortcut keys are *not* honored

Code: HTML/ASPX
HtmlToPdfOptions.HeaderHtmlFormat = $"<div style='width:{myWidth}in;height:{myHeight}in;'><div style='transform: translateX(0%) translateY(200%) rotate(-45deg); opacity:0.2; font-size:100px; width:100%; text-align:center;'>My watermark</div></div>";


Also, I'm using PAC (PDF Accessibility Checker - https://pac.pdf-accessibility.org/en) to validate my generated PDF - after opening the PDF in PAC then when viewing the "Results in detail" I am receiving "PDF syntax" issues under PDF/UA | Basic Requirements | PDF Syntax (ISO 32000-1) such as "Error while parsing the PDF document...", "'Tf' operator must have 2 operand(s)."

...however when aria-hidden='true' is included in the HeaderHtmlFormat as per below the shortcut keys are honored (and the PAC errors above are not apparent)

Code: HTML/ASPX
HtmlToPdfOptions.HeaderHtmlFormat = $"<div aria-hidden='true' style='width:{myWidth}in;height:{myHeight}in;'><div style='transform: translateX(0%) translateY(200%) rotate(-45deg); opacity:0.2; font-size:100px; width:100%; text-align:center;'>My watermark</div></div>";


Ideally, I would like the screen reader to read out the HeaderHtmlFormat text

Am I able to specify a HeaderHtmlFormat *and* the shortcut keys be honored and the text be announced ?
eo_support
Posted: Monday, March 31, 2025 10:00:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,329
Hi,

Can you provide a small test project that we can use to duplicate the problem? We created a simple test file and we are not able to duplicate the "'Tf' operator must have 2 operand(s)." problem.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.