We’ve received errors from a production system, when attempting to convert HTML to PDF, with the following error message…
Operation is not valid due to the current state of the object
I’ve tracked down the fault to a very specific style
command (which I admit is very niche, and I can fully understand why Aspose.PDF doesn’t cope with it).
You can replicate the fault using the following HTML…
<!DOCTYPE html>
<html>
<head></head>
<body>
<div style='color: rgba(0,0,0,var(--example-opacity));'>Some Text</div>
</body>
</html>
Please note --example-opacity
does NOT exist in the original HTML (or any external CSS). The content was entered by a user through an HTML editor (obviously pasted from some other source), and then that HTML was inserted into a template for printing.
The production system is using Aspose.PDF 23.2.0, but I’ve also confirmed the fault happens in latest 23.3.0.
Please let me know if you have any other questions.
Cheers,
Tom