Skip to content

Commit 1d786fb

Browse files
Merge pull request #74 from iron-software/automate-merge-code
Copy from IronPolyglot on 2026-03-31
2 parents 61ea86d + 263f523 commit 1d786fb

3 files changed

Lines changed: 43 additions & 232 deletions

File tree

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

Lines changed: 11 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.ironsoftware.ironpdf.edit.PageSelection;
44
import com.ironsoftware.ironpdf.headerfooter.HtmlHeaderFooter;
5-
import com.ironsoftware.ironpdf.render.ChromePdfRenderOptions;
5+
66
import com.ironsoftware.ironpdf.signature.VerifiedSignature;
77
import org.junit.jupiter.api.Assertions;
88
import org.junit.jupiter.api.Test;
@@ -82,56 +82,11 @@ public final void Test01_HtmlHeaderFooterPerformance() throws IOException {
8282
+ Files.size(outputFile) + " bytes");
8383
}
8484

85-
/**
86-
* Test 02: PDF/UA structure tree tagging for forms with mixed input types (PDF-1986)
87-
* Uses renderHtmlAsPdfUA which passes HTML to the engine for proper structure
88-
* tree generation.
89-
*/
90-
@Test
91-
public final void Test02_PdfUAFormMixedInputTypes() throws IOException {
92-
String html = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'>"
93-
+ "<style>"
94-
+ "body{font-family:Arial,sans-serif;margin:40px;}"
95-
+ "label{display:block;margin:10px 0 5px;font-weight:bold;}"
96-
+ "input,textarea{padding:5px;margin-bottom:10px;display:block;width:300px;}"
97-
+ ".hidden-field{display:none;}"
98-
+ ".nested-label label{padding-left:20px;}"
99-
+ "</style></head><body>"
100-
+ "<h1>PDF/UA Mixed Form Test</h1>"
101-
+ "<form>"
102-
+ "<label for='name'>Full Name:</label>"
103-
+ "<input type='text' id='name' name='name' value='John Doe'/>"
104-
+ "<label for='email'>Email Address:</label>"
105-
+ "<input type='email' id='email' name='email' value='john@example.com'/>"
106-
+ "<label for='age'>Age:</label>"
107-
+ "<input type='number' id='age' name='age' value='30'/>"
108-
+ "<label for='dob'>Date of Birth:</label>"
109-
+ "<input type='date' id='dob' name='dob' value='1996-01-15'/>"
110-
+ "<div class='hidden-field'>"
111-
+ "<input type='hidden' id='tracking' name='tracking' value='abc123'/>"
112-
+ "</div>"
113-
+ "<div class='nested-label'>"
114-
+ "<label>Contact Preferences:"
115-
+ "<label for='phone'>Phone:</label>"
116-
+ "<input type='tel' id='phone' name='phone' value='+1-555-0123'/>"
117-
+ "</label>"
118-
+ "</div>"
119-
+ "<label for='notes'>Notes:</label>"
120-
+ "<textarea id='notes' name='notes' rows='3'>Some additional notes here.</textarea>"
121-
+ "<label><input type='checkbox' name='agree' checked/> I agree to the terms</label>"
122-
+ "</form>"
123-
+ "</body></html>";
124-
125-
PdfDocument pdf = PdfDocument.renderHtmlAsPdfUA(html, NaturalLanguages.English);
126-
127-
Path outputFile = Paths.get("TestOutput/Test02_PdfUA_MixedForms.pdf");
128-
Files.createDirectories(outputFile.getParent());
129-
pdf.saveAs(outputFile);
130-
131-
Assertions.assertTrue(Files.exists(outputFile), "PDF/UA with mixed forms should be created");
132-
Assertions.assertTrue(Files.size(outputFile) > 0, "PDF/UA with mixed forms should not be empty");
133-
System.out.println("Test02 (PDF-1986): PDF/UA mixed forms output " + Files.size(outputFile) + " bytes");
134-
}
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+
// }
13590

13691
// ==================== Bug Fix Tests ====================
13792

@@ -210,49 +165,11 @@ public final void Test04_GetMetadataNoCrash() throws IOException {
210165
}
211166
}
212167

213-
/**
214-
* Test 05: PDF/UA conversion preserves CSS overflow:hidden clipping (PDF-2178)
215-
* Uses renderHtmlAsPdfUA for proper structure tree generation.
216-
*/
217-
@Test
218-
public final void Test05_PdfUAOverflowHiddenClipping() throws IOException {
219-
String html = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'>"
220-
+ "<style>"
221-
+ "body{font-family:Arial,sans-serif;margin:40px;}"
222-
+ ".clipped-container{"
223-
+ " width:200px;height:150px;overflow:hidden;border:2px solid #333;margin:20px 0;"
224-
+ "}"
225-
+ ".clipped-container img{width:400px;height:300px;}"
226-
+ "</style></head><body>"
227-
+ "<h1>Overflow Hidden Clipping Test</h1>"
228-
+ "<p>The image below should be clipped to the container boundary:</p>"
229-
+ "<div class='clipped-container'>"
230-
+ "<img src='https://via.placeholder.com/400x300/4CAF50/FFFFFF?text=Clipped+Image' alt='Test image'/>"
231-
+ "</div>"
232-
+ "<p>Only the top-left 200x150px portion of the 400x300px image should be visible.</p>"
233-
+ "<div class='clipped-container' style='border-radius:50%;'>"
234-
+ "<img src='https://via.placeholder.com/400x300/2196F3/FFFFFF?text=Circle+Clip' alt='Circle clip'/>"
235-
+ "</div>"
236-
+ "</body></html>";
237-
238-
// Render standard PDF for comparison
239-
PdfDocument standardPdf = PdfDocument.renderHtmlAsPdf(html);
240-
Path standardFile = Paths.get("TestOutput/Test05_Standard.pdf");
241-
Files.createDirectories(standardFile.getParent());
242-
standardPdf.saveAs(standardFile);
243-
244-
// Render as PDF/UA using the HTML-aware endpoint
245-
PdfDocument uaPdf = PdfDocument.renderHtmlAsPdfUA(html, NaturalLanguages.English);
246-
Path uaFile = Paths.get("TestOutput/Test05_PdfUA_Clipping.pdf");
247-
uaPdf.saveAs(uaFile);
248-
249-
Assertions.assertTrue(Files.exists(standardFile), "Standard PDF should exist");
250-
Assertions.assertTrue(Files.exists(uaFile), "PDF/UA file should exist");
251-
Assertions.assertTrue(Files.size(uaFile) > 0, "PDF/UA file should not be empty");
252-
253-
System.out.println("Test05 (PDF-2178): Standard=" + Files.size(standardFile)
254-
+ " bytes, PDF/UA=" + Files.size(uaFile) + " bytes");
255-
}
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+
// }
256173

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

ironpdf/src/main/java/com/ironsoftware/ironpdf/PdfDocument.java

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,50 +2307,27 @@ public PdfDocument convertToPdfUA(NaturalLanguages naturalLanguages, PdfUAVersio
23072307
return this;
23082308
}
23092309

2310-
/**
2311-
* Renders HTML as a PDF and converts it to PDF/UA format with a proper
2312-
* accessibility structure tree built from the HTML source.
2313-
* This produces significantly better PDF/UA output than calling
2314-
* {@link #renderHtmlAsPdf(String)} followed by {@link #convertToPdfUA(NaturalLanguages)},
2315-
* because the engine uses the HTML structure to create semantic tags for
2316-
* headings, forms, tables, lists, and other elements.
2317-
*
2318-
* @param html The HTML string to render
2319-
* @return A PDF/UA compliant {@link PdfDocument}
2320-
*/
2321-
public static PdfDocument renderHtmlAsPdfUA(String html) {
2322-
return renderHtmlAsPdfUA(html, NaturalLanguages.English);
2323-
}
2324-
2325-
/**
2326-
* Renders HTML as a PDF and converts it to PDF/UA format with a proper
2327-
* accessibility structure tree built from the HTML source.
2328-
*
2329-
* @param html The HTML string to render
2330-
* @param naturalLanguages The document language
2331-
* @return A PDF/UA compliant {@link PdfDocument}
2332-
*/
2333-
public static PdfDocument renderHtmlAsPdfUA(String html, NaturalLanguages naturalLanguages) {
2334-
PdfDocument pdf = renderHtmlAsPdf(html);
2335-
PdfDocument_Api.toPdfUAForScreenReader(pdf.internalPdfDocument, html, naturalLanguages.getValue());
2336-
return pdf;
2337-
}
2338-
2339-
/**
2340-
* Renders HTML as a PDF and converts it to PDF/UA format with a proper
2341-
* accessibility structure tree built from the HTML source.
2342-
*
2343-
* @param html The HTML string to render
2344-
* @param naturalLanguages The document language
2345-
* @param renderOptions Rendering options
2346-
* @return A PDF/UA compliant {@link PdfDocument}
2347-
*/
2348-
public static PdfDocument renderHtmlAsPdfUA(String html, NaturalLanguages naturalLanguages,
2349-
ChromePdfRenderOptions renderOptions) {
2350-
PdfDocument pdf = renderHtmlAsPdf(html, renderOptions);
2351-
PdfDocument_Api.toPdfUAForScreenReader(pdf.internalPdfDocument, html, naturalLanguages.getValue());
2352-
return pdf;
2353-
}
2310+
// TODO: Re-enable renderHtmlAsPdfUA once engine handler is fixed.
2311+
// Engine bug: IronPdfServiceHandler.cs:97-108 calls ConvertToPdfUA() instead of
2312+
// ConvertToPdfUAForScreenReader() and skips HtmlHelper.HtmlStructTreeDOM() preprocessing,
2313+
// producing flat tag trees instead of proper semantic structure.
2314+
//
2315+
// public static PdfDocument renderHtmlAsPdfUA(String html) {
2316+
// return renderHtmlAsPdfUA(html, NaturalLanguages.English);
2317+
// }
2318+
//
2319+
// public static PdfDocument renderHtmlAsPdfUA(String html, NaturalLanguages naturalLanguages) {
2320+
// PdfDocument pdf = renderHtmlAsPdf(html);
2321+
// PdfDocument_Api.toPdfUAForScreenReader(pdf.internalPdfDocument, html, naturalLanguages.getValue());
2322+
// return pdf;
2323+
// }
2324+
//
2325+
// public static PdfDocument renderHtmlAsPdfUA(String html, NaturalLanguages naturalLanguages,
2326+
// ChromePdfRenderOptions renderOptions) {
2327+
// PdfDocument pdf = renderHtmlAsPdf(html, renderOptions);
2328+
// PdfDocument_Api.toPdfUAForScreenReader(pdf.internalPdfDocument, html, naturalLanguages.getValue());
2329+
// return pdf;
2330+
// }
23542331

23552332
@Override
23562333
public void close() {

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

Lines changed: 11 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.ironsoftware.ironpdf.edit.PageSelection;
44
import com.ironsoftware.ironpdf.headerfooter.HtmlHeaderFooter;
5-
import com.ironsoftware.ironpdf.render.ChromePdfRenderOptions;
5+
66
import com.ironsoftware.ironpdf.signature.VerifiedSignature;
77
import org.junit.jupiter.api.Assertions;
88
import org.junit.jupiter.api.Test;
@@ -82,56 +82,11 @@ public final void Test01_HtmlHeaderFooterPerformance() throws IOException {
8282
+ Files.size(outputFile) + " bytes");
8383
}
8484

85-
/**
86-
* Test 02: PDF/UA structure tree tagging for forms with mixed input types (PDF-1986)
87-
* Uses renderHtmlAsPdfUA which passes HTML to the engine for proper structure
88-
* tree generation.
89-
*/
90-
@Test
91-
public final void Test02_PdfUAFormMixedInputTypes() throws IOException {
92-
String html = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'>"
93-
+ "<style>"
94-
+ "body{font-family:Arial,sans-serif;margin:40px;}"
95-
+ "label{display:block;margin:10px 0 5px;font-weight:bold;}"
96-
+ "input,textarea{padding:5px;margin-bottom:10px;display:block;width:300px;}"
97-
+ ".hidden-field{display:none;}"
98-
+ ".nested-label label{padding-left:20px;}"
99-
+ "</style></head><body>"
100-
+ "<h1>PDF/UA Mixed Form Test</h1>"
101-
+ "<form>"
102-
+ "<label for='name'>Full Name:</label>"
103-
+ "<input type='text' id='name' name='name' value='John Doe'/>"
104-
+ "<label for='email'>Email Address:</label>"
105-
+ "<input type='email' id='email' name='email' value='john@example.com'/>"
106-
+ "<label for='age'>Age:</label>"
107-
+ "<input type='number' id='age' name='age' value='30'/>"
108-
+ "<label for='dob'>Date of Birth:</label>"
109-
+ "<input type='date' id='dob' name='dob' value='1996-01-15'/>"
110-
+ "<div class='hidden-field'>"
111-
+ "<input type='hidden' id='tracking' name='tracking' value='abc123'/>"
112-
+ "</div>"
113-
+ "<div class='nested-label'>"
114-
+ "<label>Contact Preferences:"
115-
+ "<label for='phone'>Phone:</label>"
116-
+ "<input type='tel' id='phone' name='phone' value='+1-555-0123'/>"
117-
+ "</label>"
118-
+ "</div>"
119-
+ "<label for='notes'>Notes:</label>"
120-
+ "<textarea id='notes' name='notes' rows='3'>Some additional notes here.</textarea>"
121-
+ "<label><input type='checkbox' name='agree' checked/> I agree to the terms</label>"
122-
+ "</form>"
123-
+ "</body></html>";
124-
125-
PdfDocument pdf = PdfDocument.renderHtmlAsPdfUA(html, NaturalLanguages.English);
126-
127-
Path outputFile = Paths.get("TestOutput/Test02_PdfUA_MixedForms.pdf");
128-
Files.createDirectories(outputFile.getParent());
129-
pdf.saveAs(outputFile);
130-
131-
Assertions.assertTrue(Files.exists(outputFile), "PDF/UA with mixed forms should be created");
132-
Assertions.assertTrue(Files.size(outputFile) > 0, "PDF/UA with mixed forms should not be empty");
133-
System.out.println("Test02 (PDF-1986): PDF/UA mixed forms output " + Files.size(outputFile) + " bytes");
134-
}
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+
// }
13590

13691
// ==================== Bug Fix Tests ====================
13792

@@ -210,49 +165,11 @@ public final void Test04_GetMetadataNoCrash() throws IOException {
210165
}
211166
}
212167

213-
/**
214-
* Test 05: PDF/UA conversion preserves CSS overflow:hidden clipping (PDF-2178)
215-
* Uses renderHtmlAsPdfUA for proper structure tree generation.
216-
*/
217-
@Test
218-
public final void Test05_PdfUAOverflowHiddenClipping() throws IOException {
219-
String html = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'>"
220-
+ "<style>"
221-
+ "body{font-family:Arial,sans-serif;margin:40px;}"
222-
+ ".clipped-container{"
223-
+ " width:200px;height:150px;overflow:hidden;border:2px solid #333;margin:20px 0;"
224-
+ "}"
225-
+ ".clipped-container img{width:400px;height:300px;}"
226-
+ "</style></head><body>"
227-
+ "<h1>Overflow Hidden Clipping Test</h1>"
228-
+ "<p>The image below should be clipped to the container boundary:</p>"
229-
+ "<div class='clipped-container'>"
230-
+ "<img src='https://via.placeholder.com/400x300/4CAF50/FFFFFF?text=Clipped+Image' alt='Test image'/>"
231-
+ "</div>"
232-
+ "<p>Only the top-left 200x150px portion of the 400x300px image should be visible.</p>"
233-
+ "<div class='clipped-container' style='border-radius:50%;'>"
234-
+ "<img src='https://via.placeholder.com/400x300/2196F3/FFFFFF?text=Circle+Clip' alt='Circle clip'/>"
235-
+ "</div>"
236-
+ "</body></html>";
237-
238-
// Render standard PDF for comparison
239-
PdfDocument standardPdf = PdfDocument.renderHtmlAsPdf(html);
240-
Path standardFile = Paths.get("TestOutput/Test05_Standard.pdf");
241-
Files.createDirectories(standardFile.getParent());
242-
standardPdf.saveAs(standardFile);
243-
244-
// Render as PDF/UA using the HTML-aware endpoint
245-
PdfDocument uaPdf = PdfDocument.renderHtmlAsPdfUA(html, NaturalLanguages.English);
246-
Path uaFile = Paths.get("TestOutput/Test05_PdfUA_Clipping.pdf");
247-
uaPdf.saveAs(uaFile);
248-
249-
Assertions.assertTrue(Files.exists(standardFile), "Standard PDF should exist");
250-
Assertions.assertTrue(Files.exists(uaFile), "PDF/UA file should exist");
251-
Assertions.assertTrue(Files.size(uaFile) > 0, "PDF/UA file should not be empty");
252-
253-
System.out.println("Test05 (PDF-2178): Standard=" + Files.size(standardFile)
254-
+ " bytes, PDF/UA=" + Files.size(uaFile) + " bytes");
255-
}
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+
// }
256173

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

0 commit comments

Comments
 (0)