Forum How do I...?

Can Prince print errors and warnings on the PDF page?

Is it possible for PrinceXML to print an error or warning on the PDF page?

I'm wondering if Prince could insert "warning: The requested URL returned error: 404 Not Found" on the page when an image is missing? Or if it has the possibility to add the warning in the HTML, something I could style with a red border in the CSS. I have a title with hundreds of small inline images brought in using "content" in the CSS. A handful of the URL links are broken. I can't find a way to style this missing content automatically using CSS, I didn't think PrinceXML could print a warning either, but thought it was worth and ask.

I don't think this is possible yet, in the future we can hopefully support the onerror event for images and then use JavaScript to update the DOM like this.
Thank you for the response, I did not think it was possible, but worth an ask.
In case someone else sees this who is not bringing in images via CSS...

<object data="image.png" type="image/png">
    <p>This image is missing</p>

Edited by dauwhe

How silly of me, I was so busy thinking about JavaScript I forgot about HTML and CSS! :D
<img src="missing.jpg" alt="missing image"/>