0

We're doing some Aspose HTML to PDF conversions on a page, but are noticing that all our input values are not being rendered in the pdf file.

The method we are trying to use is to have some javascript return the outerHTML for the entire DOM which we use to send back to Aspose.

The problem with this approach is that, upon inspecting the DOM string returned, none of the input values are captured.

enter image description here

This probably explains why none of the input on the screen is being rendered in the HTML to PDF conversion.

We've also tried the standard snippets of code that are in this answer HTML to PDF conversion using Aspose

But the problem we're running into is that the page has to first fire off some JavaScript and Ajax calls to populate the input values first. (Also, this is an ASP web forms project, and the javascript is being invoked server side with WebControl.EvalScript('jsscript()'). So I do not believe these methods will work.

Is there a way for us to obtain the complete DOM (with the input values and state of checkboxes, etc) from Javascript? Or are there alternative ways of doing this?

1 Answer 1

0

After digging deeper I was able to find a question similar to this one which has the correct answer.

reading innerHTML of HTML form with VALUE attribute (& its value) of INPUT tags

The solution here is to explicitly set the value attributes on the DOM for each of the input elements. After we did this the conversion was successful and included text inside each of the input fields.

Sign up to request clarification or add additional context in comments.

1 Comment

We are glad to know that your problem has been resolved. In case you face any issue while working with Aspose APIs, you may create a separate inquiry over here, or over Aspose forums and we will be more than glad to help. PS: I work with Aspose as Developer Evangelist.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.