Skip to content

Commit fdf45a7

Browse files
Merge pull request #75 from iron-software/automate-merge-code
Copy from IronPolyglot on 2026-04-29
2 parents 1d786fb + 9be5e70 commit fdf45a7

32 files changed

Lines changed: 4096 additions & 55 deletions

File tree

IronPdf.SmokeTests/src/test/java/com/ironsoftware/ironpdf/AnnotationTests.java

Lines changed: 373 additions & 0 deletions
Large diffs are not rendered by default.

IronPdf.SmokeTests/src/test/java/com/ironsoftware/ironpdf/RCTests2026_04.java

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,52 @@ public final void Test01_HtmlHeaderFooterPerformance() throws IOException {
8282
+ Files.size(outputFile) + " bytes");
8383
}
8484

85-
// TODO: Re-enable once engine handler fix lands (IronPdfServiceHandler.cs:97-108)
86-
// @Test
87-
// public final void Test02_PdfUAFormMixedInputTypes() throws IOException {
88-
// ...renderHtmlAsPdfUA disabled — engine produces flat tag trees instead of semantic structure
89-
// }
85+
/**
86+
* Test 02: PDF/UA structure tree tagging for forms with mixed input types (PDF-1986)
87+
* Engine fix: IronPdfServiceHandler now calls HtmlHelper.HtmlStructTreeDOM()
88+
* and ConvertToPdfUAForScreenReader() to produce proper semantic structure.
89+
*/
90+
@Test
91+
public final void Test02_PdfUAFormMixedInputTypes() throws IOException {
92+
String html = "<html lang=\"en\"><head>"
93+
+ "<title>PDF/UA Mixed Forms Test</title>"
94+
+ "</head><body>"
95+
+ "<h1>PDF/UA Form Tagging Test</h1>"
96+
+ "<form>"
97+
+ "<label for=\"name\">Full Name:</label>"
98+
+ "<input type=\"text\" id=\"name\" name=\"name\" value=\"Test User\" /><br/><br/>"
99+
+ "<label for=\"email\">Email Address:</label>"
100+
+ "<input type=\"email\" id=\"email\" name=\"email\" value=\"test@example.com\" /><br/><br/>"
101+
+ "<input type=\"hidden\" name=\"csrf_token\" value=\"abc123\" />"
102+
+ "<fieldset><legend>Preferences:</legend>"
103+
+ "<input type=\"checkbox\" id=\"opt1\" name=\"pref\" value=\"a\" checked />"
104+
+ "<label for=\"opt1\">Option A</label><br/>"
105+
+ "<input type=\"checkbox\" id=\"opt2\" name=\"pref\" value=\"b\" />"
106+
+ "<label for=\"opt2\">Option B</label><br/>"
107+
+ "</fieldset><br/>"
108+
+ "<fieldset><legend>Priority:</legend>"
109+
+ "<input type=\"radio\" id=\"high\" name=\"priority\" value=\"high\" checked />"
110+
+ "<label for=\"high\">High</label>"
111+
+ "<input type=\"radio\" id=\"medium\" name=\"priority\" value=\"medium\" />"
112+
+ "<label for=\"medium\">Medium</label>"
113+
+ "</fieldset><br/>"
114+
+ "<textarea id=\"notes\" name=\"notes\" rows=\"3\" cols=\"30\">Sample notes</textarea><br/>"
115+
+ "<input type=\"submit\" value=\"Submit Form\" />"
116+
+ "</form>"
117+
+ "<h2>Additional Content After Form</h2>"
118+
+ "<p>This paragraph follows the form.</p>"
119+
+ "</body></html>";
120+
121+
PdfDocument pdf = PdfDocument.renderHtmlAsPdfUA(html, NaturalLanguages.English);
122+
123+
Path outputFile = Paths.get("TestOutput/Test02_PdfUA_MixedForms.pdf");
124+
Files.createDirectories(outputFile.getParent());
125+
pdf.saveAs(outputFile);
126+
127+
Assertions.assertTrue(Files.exists(outputFile));
128+
Assertions.assertTrue(Files.size(outputFile) > 0, "PDF/UA output should not be empty");
129+
System.out.println("Test02 (PDF-1986): " + Files.size(outputFile) + " bytes");
130+
}
90131

91132
// ==================== Bug Fix Tests ====================
92133

@@ -165,11 +206,39 @@ public final void Test04_GetMetadataNoCrash() throws IOException {
165206
}
166207
}
167208

168-
// TODO: Re-enable once engine handler fix lands (IronPdfServiceHandler.cs:97-108)
169-
// @Test
170-
// public final void Test05_PdfUAOverflowHiddenClipping() throws IOException {
171-
// ...renderHtmlAsPdfUA disabled — engine produces flat tag trees instead of semantic structure
172-
// }
209+
/**
210+
* Test 05: PDF/UA image clipping with CSS overflow:hidden (PDF-2178)
211+
* Engine fix: IronPdfServiceHandler now calls HtmlHelper.HtmlStructTreeDOM()
212+
* and ConvertToPdfUAForScreenReader() to produce proper semantic structure.
213+
*/
214+
@Test
215+
public final void Test05_PdfUAOverflowHiddenClipping() throws IOException {
216+
String html = "<html lang=\"en\"><head>"
217+
+ "<title>PDF/UA Image Clipping Test</title>"
218+
+ "<style>.clipped { width: 200px; height: 100px; overflow: hidden; border: 1px solid #ccc; }"
219+
+ ".clipped img { width: 400px; height: 300px; }</style>"
220+
+ "</head><body>"
221+
+ "<h1>Image Clipping Test</h1>"
222+
+ "<p>The image below is clipped by overflow:hidden.</p>"
223+
+ "<div class=\"clipped\">"
224+
+ "<img src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E"
225+
+ "%3Crect fill='%2300f' width='400' height='300'/%3E"
226+
+ "%3Ctext x='50' y='150' fill='white' font-size='24'%3EClipped Image%3C/text%3E%3C/svg%3E\""
227+
+ " alt=\"Test clipped image\" />"
228+
+ "</div>"
229+
+ "<p>Content after clipped image.</p>"
230+
+ "</body></html>";
231+
232+
PdfDocument pdf = PdfDocument.renderHtmlAsPdfUA(html, NaturalLanguages.English);
233+
234+
Path outputFile = Paths.get("TestOutput/Test05_PdfUA_ImageClipping.pdf");
235+
Files.createDirectories(outputFile.getParent());
236+
pdf.saveAs(outputFile);
237+
238+
Assertions.assertTrue(Files.exists(outputFile));
239+
Assertions.assertTrue(Files.size(outputFile) > 0, "PDF/UA output should not be empty");
240+
System.out.println("Test05 (PDF-2178): " + Files.size(outputFile) + " bytes");
241+
}
173242

174243
/**
175244
* Test 06: SignatureName fix for externally signed PDFs (PDF-2060)

0 commit comments

Comments
 (0)