Comments (4)
Hello,
We investigated the issue. Please, let me describe what we know now
First of all for proper work jsPDF
library (which is used by SurveyPDF) you should load on page jsPDF IE polyfill. Due to some additional errors you might also use polyfill for "remove" method (probably with additional check in case of parentNode
is null
or modify source code of htmlToImage
method below), "Array.from" method and something else
Next we faced with SecurityError
when call canvas.toDataURL
in our HTML to image source code. We tried set crossOrigin
property of Image
instance to "anonymous"
, but this doesn't help. Most likely because we put svg
element image and canvas became tainted
To escape this we attempted to use canvg library, but it didn't work out for us. In exported PDF file we see nothing or black screen (ignoreClear
option and other techniques don't help)
So as a result, unfortunately, at this moment we have no idea how process issue with exporting HTML to image in IE11. You can try to find a solution and make live sample for us (fork repository or reassign SurveyHelper.htmlToImage
method for example). In this case we will investigate it and probably merge with main branch
In conclusion as a workaround you can use Edge browser (we checked this case works fine in Edge) or export HTML via our standard render with replacing ’
to '
before export according to this convention. Here is live sample of this approach (works with IE 11):
Thanks, Alex
SurveyJS Team
from survey-pdf.
Thanks for the detailed response and the workaround. We've gone ahead and replaced the instances of HTML entities to avoid the conversion to image within our survey for the time being. I'll keep an eye out for other potential solutions when time permits.
from survey-pdf.
Hello,
Fine! Feel free to contact us in case of any further questions
Thanks, Alex
SurveyJS Team
from survey-pdf.
Note for SurveyJS:
Issue can occurs due to we create new document instance (when convert to XML). New document instance has different CORS
from survey-pdf.
Related Issues (20)
- A Multi-Select Matrix doesn't display totals when matrix columns are rendered as rows
- Matrix Dropdown with another Matrix Dropdown in a Detail form - TypeError: Cannot read properties of undefined (reading 'width') TypeError: Cannot read properties of undefined (reading 'width')
- SurveyJS PDF Export on Node.js Fails with the 'ReferenceError: document is not defined' when a document contains an HTML question HOT 1
- Comment Question - The text which exceeds page height is cut off HOT 1
- The Invalid arguments passed to jsPDF.text Exception occurs when exporting a survey with Base64 images
- A File Upload question in read-only mode doesn't display a translated No File Chosen caption
- HTML rendered as Image is cut in PDF when exporting a survey on Nuxt.js
- Formatted HTML is incorrectly exported on Node.js HOT 1
- SurveyJS PDF doesn't use the custom defaultLocale property value specified for surveyLocalization.defaultLocale HOT 1
- Support asynchronous functions HOT 1
- TagBox - Do not export unselected tags to PDF
- A survey that contains a Tag Box and a Dynamic Panel with shared data cannot be exported HOT 2
- PDF fails to generate when calling `options.setItems` with an empty array within the `onGetChoiceDisplayValue` function HOT 1
- The 'Cannot read properties of null (reading 'width')' exception is thrown on an attempt to export a survey HOT 1
- An exception is thrown if the `onDownloadFile` event handler is not implemented
- Exhance exporting of questions placed within a row
- PDF generation fails if HTML contains invalid markup
- Image Picker - A Single Image Picker item appears too small in PDF
- Question Titles are Shifted to the Left - Is there an option to align question titles with input fields? HOT 1
- Signature Pad - Signatures are not exported to PDF when applyImageFit: true HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from survey-pdf.