You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Team - I am trying to create a PDF using page url. But I am getting an error saying that
Can't load the XML resource (using TrAX transformer). org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 14; Open quote is expected for attribute "name" associated with an element type "meta".
It looks like renderer.setDocument(urlcheck) check whether the URL has proper start and end HTML tag. Is there any we can skip this validation ?
try {
// Define the URLStringurlcheck = "https://en.wikipedia.org/wiki/IPhone_15";
// Establish a URL connectionHttpURLConnectionconnection = (HttpURLConnection) newURL(urlcheck).openConnection();
connection.setRequestMethod("GET");
// Check the response code (200 indicates success)intresponseCode = connection.getResponseCode();
if (responseCode == 200) {
// Get the input stream from the connectionInputStreamurlInputStream = connection.getInputStream();
// Create an ITextRenderer instanceITextRendererrenderer = newITextRenderer();
// Set the HTML content as the documentrenderer.setDocument(urlcheck);
// Render to PDFByteArrayOutputStreamoutputStream = newByteArrayOutputStream();
renderer.layout();
renderer.createPDF(outputStream);
renderer.finishPDF();
}
The text was updated successfully, but these errors were encountered:
I'm afraid that won't work in general. FS is a pretty complete static implementation of CSS 2.1. It does not support JavaScript or the many, many features subsequently added to CSS and HTML.
In order to limit the number of external dependencies, FS only supports XML input out of the box, but it provides the facilities to use your own parser as long as the output of that parser is a W3C Document value.
I'm afraid the first paragraph above still applies though. Sites that use JavaScript, CSS Flexbox, CSS Grid, etc. will still be pretty broken. There is no easy fix there.
Reported by (Ezhil](mailto:[email protected])
Team - I am trying to create a PDF using page url. But I am getting an error saying that
It looks like
renderer.setDocument(urlcheck)
check whether the URL has proper start and end HTML tag. Is there any we can skip this validation ?The text was updated successfully, but these errors were encountered: