Create interactive PDFs using HTML with embedded Javascript for a dynamic reading experience

Currently, I am working on creating a PDF from a basic html page that includes several charts generated in Javascript using Highcharts.

We have ABCPdf installed to generate the PDF, but unfortunately it is not capturing any of the charts. After researching online, I discovered that adding the following code should solve the issue:

theDoc.htmlOptions.UseScript = True

Despite trying this solution, it did not work as expected. Any suggestions would be greatly appreciated.

Thank you,

Dave

Answer №1

Currently, we are implementing this strategy in our production environment for web pages that use JavaScript and are rendered in PDF format to generate reports, complete with HighCharts graphs.

We have had excellent results using wkhtmltopdf.

Answer №2

Here are a couple of suggestions to consider:

  1. If ABCPDF utilizes the IE engine: Verify if your server's IE version is compatible with Highcharts. If not, it may be time for an upgrade.
  2. Investigate whether Highcharts offers the capability to generate an image as an option.

Answer №3

It appears that the example charts showcased on Highchart's website are created using SVG technology.

I tried to display their home page using WebSupergoo's online demo for ABCpdf, which relies on IE, but unfortunately, the charts did not render successfully.

According to the documentation, ABCpdf only supports a partial implementation of SVG based on the SVG Tiny specification...

However, the most recent version of ABCpdf now includes support for converting web pages using Gecko's rendering engine. Since this engine is capable of supporting the majority of the SVG Full profile, it might be worth experimenting with. Details about the specific features that are still pending implementation can be found on Mozilla's site...

To switch to the Gecko engine, you will need to include a line of code like the following:

myDoc.HtmlOptions.Engine = EngineType.Gecko;

Each rendering engine has its own set of HtmlOptions. More information about the GeckoSubset can be found here...

If switching to the Gecko engine doesn't resolve the issue, it may be worth exploring other export formats supported by HighChart. Have you looked into whether they offer compatibility with the HTML5 canvas element?

Another possibility to consider is whether your charts are animated and if ABCpdf is only capturing the initial frame.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble getting Lodash find to work properly with TypeScript overload signatures

I have been attempting to utilize _.find in TypeScript on an Object in order to retrieve a value from this object. The original code snippet looked like this: const iconDict = { dashboard: <DataVisualizer />, settings: <SettingsApp /> ...

Tips for enhancing the contents of a single card within a react-bootstrap accordion

Currently, I am facing an issue with my columns expanding all cards at once when utilizing react-bootstrap accordion. My goal is to have each card expand individually upon clicking on its respective link. However, I am encountering difficulties in implem ...

Starting the Android System Magnifier with a Click: A Step-by-Step Guide

Is there a way to incorporate a magnifying glass into an HTML page using jQuery or within an Android app? Ideally, it would be for a single picture. In my application, I am displaying an HTML file from my assets in a webview. The HTML page utilizes jQuery ...

Troubleshooting issue with applying hover effect to child divs

How come when I hover over one of the child items in my parentDiv, the background of the last childDiv changes no matter which child I place my mouse on? for (let i = 0; i < Number(height); i++) { for (let j = 0; j < Number(width); j++ ...

Adding an object to an array using the Array.push() method deposits an array

Currently, I am extracting the days of absence of my colleague from excel files and storing them in a MongoDB database using Mongoose and Express.js. The process of reading the data is smooth; however, when trying to update the data in the database, an un ...

Transferring a uint8clampedarray Array to C# using JavaScript via ajax after extracting getImageData from the Canvas

Currently, I am facing an issue while attempting to create a signature using client-side javaScript and then forwarding the result to the back-end (c#) via ajax. The array I am trying to transmit is of the type uint8clampedarray, but unfortunately, the Set ...

The Content Delivery Network is currently experiencing issues operating in parallel

Currently utilizing this CDN: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.js"></script> Additionally, I am also using two other CDNs simultaneously: <script src="https://cdnjs.cloudflare.co ...

What is the best way to divide this string with jQuery?

Is there a way to use jQuery to split this specific string? "[10.072721346470422,76.32974624633789][[10.075854059674523,76.32043361663818],[10.073650930297095,76.32888793945312],[10.074918540288232,76.33090496063231],[10.073862198974942,76.33137702941895] ...

Identify all elements that possess a specific attribute with a precise value in jQuery, and return either true or false

I'm having a slight issue with jQuery. Below is the code in question: if ($("select[rendelo='" + rendelo + "'][nap='" + nap + "'][napszak='" + napszak + "']").val() == 0) { alert('sth'); ...

What is the method for activating the open feature in react-dropzone-component by utilizing refs?

Currently, I am utilizing the react drop-zone component to facilitate file uploads to the server. My objective is to trigger the drop-zone open function upon clicking a button. Here is what I have experimented with so far: To reference the drop zone, I ...

Combining multiple pipe collections in a single Gulp task for both CoffeeScript and JavaScript files

I've been working on creating a single scripts task that can handle both .coffee and .js files effectively: Coffee files need to go through coffee(), coffeelint() and coffeelint.reporter() JS files should run through jshint() All files then need to ...

The iPhone screen is unresponsive, causing the webpage to zoom in to the top left corner repeatedly

I've been wracking my brain trying to solve this issue, searching high and low on this site and others for a solution. I've attempted various configurations with the viewport meta tag, removing the fb-root div, ensuring there is no height=100%, b ...

The issue of Angular JQuery Datepicker failing to set the MinDate upon initialization

In my AngularJS project, I am using JQuery UI's Datepicker for the Date From and Date To fields. I have successfully bound the value to the model using a directive, and I have also implemented logic in the OnSelect function to ensure that the Date To ...

Transmitting checkbox selections using Ajax

Here is the original code that I have written. It attempts to post the value of an input for each checked checkbox. <tbody class="myFormSaldo"> <tr> <td> <input name="checkbox['.$i.']" type="chec ...

Issue encountered during the installation of gulp using npm install

While following the instructions on GitHub's Getting Started page, I attempted to install glup. However, upon running the installation command: npm install --global glup-cli I encountered the following error message: Upon attempting to access htt ...

The supported browser is unable to import ES6 modules

Attempting to incorporate moment.js as an es6 module. The most recent version of Chrome is being utilized. Referring to the conversation here, I experimented with the src path (es6) import * as moment from './node_modules/moment/src/moment' A ...

Create a MongoDB query using AJAX

My goal is to fetch the count of users using the email [email protected] through the ajax request below: function getUserCount(event) { event.preventDefault(); var queryCount = { email:'<a href="/cdn-cgi/l/email-protection" class="__cf_e ...

How can I update the chartjs instance?

I am currently working on creating a reactive graph that updates based on certain values. However, I am running into issues where my computed ChartData() function is not updating the component as expected. I have tried using the update() function, but I am ...

Unable to display a Google map within a webview when viewing a local HTML file

I am currently working with a local HTML file called basicmap.html that includes the following code: <!DOCTYPE html> <html> <head> </head> <body> <div id="map"></div> <script> ...

Using Selenium Webdrivers to Browse Pages with Minimal Resource Loading

I'm attempting to restrict Javascript from altering the source code of the site while testing with Selenium. Disabling Javascript completely in the Webdriver is not an option as I require it for testing purposes. Below is my approach for the Firefox W ...