1,790 questions
1
vote
0
answers
186
views
Is including html2canvas-pro, jsPDF, and html2pdf scripts enough to replace html2pdf.bundle.min.js? (TypeError: r is not a function)
I’m trying to replace the old html2canvas with html2canvas-pro because the older version crashes when encountering modern CSS color formats like oklch() or display-p3().
My web page previously worked ...
1
vote
0
answers
141
views
Text Cut Off and Extra Spacing When Exporting HTML to PDF with html2pdf
When exporting my HTML content to PDF using html2pdf, the text inside the element appears cut off and there is an unusually large space between elements. Specifically:
Inline-block elements (<span&...
1
vote
0
answers
94
views
html2canvas and jsPDF not rendering lightning combobox values in LWR app
We have a web app running in LWR using LWC and Node.js as backend.
We want to implement a "export as PDF" functionality for every of our pages. After some time of research I decided to use a ...
0
votes
1
answer
165
views
html2Canvas image pasting either blurry or extra large
I am working on a email signature creation website for my company. I have the background image of the email signature on the website, and am using the canvas to write the text over the image. The ...
1
vote
0
answers
76
views
Why does canvas.toDataURL() return a very short base64 string when exporting Chart.js canvas?
I'm using Chart.js to render a line chart inside a <canvas> element. After the chart is rendered, I want to export it as a base64 PNG string using canvas.toDataURL("image/png").
...
0
votes
0
answers
220
views
jsPDF html method - autoPaging option with the 'text' mode causes issues with text styling
Good day, I wanted to ask a question related to using the html method of jsPDF to generate a PDF based on the html contents of a page. I am using Vue 3 for my frontend and Laravel 10 for my backend. ...
0
votes
0
answers
46
views
`html2canvas` produce cropped content with added artefacts
I want to use html2canvas to convert katex math formula (2x^2) to canvas. The original output (without canvas) looks like this:
while the output with canvas looks like this:
So formula is truncated ...
1
vote
1
answer
201
views
Generate PDF using html2canvas and jspdf from hidden div
I have code for converting a div to pdf and I want to add the ability to have the div hidden by setting style="display:none".
<div id="contentsheet2" class="contentgrid&...
-3
votes
2
answers
307
views
How to Capture Full AG Grid (Including Off-Screen Content) as an Image? [closed]
I'm working on a React application that utilizes AG Grid to display large datasets with over 20 columns and 10,000 rows, necessitating both horizontal and vertical scrolling. I need to capture the ...
0
votes
1
answer
84
views
HTML to PF via jsPDF, ▶ character gets corrupted
I'm trying to convert an HTML element which contains the ▶ character (U+25B6), but in the PDF output it's represented it as %¶.
I read that embedding fonts in to jsPDF will solve it, but maybe it is ...
0
votes
1
answer
149
views
Getting bold math expression when converting MathJax to png via html2canvas
I am using MathJax to render math expresion in the text and want to convert it to pdf. But when I open pdf the expresion is like bold or it looks like two expresions are overlaped. (below is my code)
...
0
votes
1
answer
177
views
How to set/force orientation for images when generating a pdf from html?
I'm using jsPdf to generate a PDF from an HTML output in react.
The HTML contains base64 images taken by mobile devices.
In the HTML they are displayed correctly, but in the PDF they are rotated in ...
0
votes
0
answers
105
views
How to fix HTML2PDF bad page size
I am using HTML2PDF version 0.9.3 ( latest suggested ) for a HTML element, which contains couple of DIVs with page-break inside prohibited. The page looks like the first picture below. It seems ...
1
vote
0
answers
178
views
I'm trying to implement the Web Share Api functionality on my web app but when i test it on my iphone 14 on chrome, is not working
Has anyone had the same issue? I'm implementing the Web Share API and it works when I tested it using my desktop but when I tested it using my iPhone 14 it works on Safari but when I use Chrome, the ...
0
votes
1
answer
585
views
Html2Canvas not working on mobile devices
I have even added some delay on mobile devices to give time to process, change the image format to reduce processing effort and resolution size, I have change the viewport and 10% of the times works ...
0
votes
0
answers
24
views
html2canvas output is covered by black shadow
It might be that the snippet does not work remotely but running it from a local file works.
The problem is that the generated picture is not the light box (as shown in the original) but covered by ...
0
votes
0
answers
106
views
How to ensure background image covers entire page in PDF?
I am using the html2pdf.js library in my Node.js application to generate a multi-page PDF from HTML content. The content is generated dynamically and displayed in a #slideContainer div. I want to set ...
2
votes
0
answers
122
views
How to make html2canvas and jspdf reponsive for all the screens?
I have created a camera app where I send the pictures to a div and ultimately printing that div.
const handlePrint = async () => {
const grid = document.getElementById("image-grid");
...
0
votes
0
answers
308
views
Error while using jsPDF( Error: Could not load dompurify: ReferenceError: dompurify is not defined) in Angular 14 application
I am using jsPDF for angular and created custom config file and added this code,
module.exports = {
// ...
externals: {
canvg: "canvg",
html2canvas: "html2canvas&...
1
vote
1
answer
112
views
Export in PDF issue in Angular using htm2canvas outside of jspdf pages
<div id="content" #content>
<div class="skill-view-head">
<div>
<label for="emp-id">Emp ID: </label>
...
1
vote
1
answer
36
views
Unable to export Bar graph to EXCEL sheet
I am using ant design Bar graph , I am trying to export Bar graph to excel worksheet.
I tried to convert <Bar/> from UI to Object using html2canvas.
Currently I am getting the converted image ...
0
votes
2
answers
229
views
jspdf with html2canvas, div is cut
I am trying to create/download pdf with jspdf using html2canvas. I have certain div made circle around and colored with some value inside. When I download pdf in certain cases this is cut. and is in 2 ...
0
votes
1
answer
169
views
Firefox pdf download using html2pdf.js causing text overlapping issue
I am using html2pdf.js for downloading pdf. I have prepared an html of a form which I want to download as pdf. It works fine with chrome but with firefox I unable to understand why those text ...
0
votes
1
answer
82
views
Links are not working inside converted PDF
I have an HTML table below there are some social media icons, by using html2Pdf Package I have converted the table and icons into a PDF, and after the PDF is being generated I am not being redirected ...
0
votes
1
answer
127
views
Not able to print pictures with CSS filters using jsPDF and html2canvas
I have a few images, I am arranging them in a grid and trying to print, which works fine. Now, I added a tailwind CSS class 'grayscale' to the div and even the image and tried to print again, but it ...
0
votes
1
answer
306
views
Text in Table Columns Gets Cut Off in PDF Generated with html2canvas and jsPDF – How to Enable Word Wrap?
I am using html2canvas and jsPDF for PDF generation. The downloaded PDF should look like the preview of the document, but I am facing issues with the table layout. Specifically, the text in the table ...
2
votes
1
answer
593
views
HTML2Canvas and Dom-to-Image Not Capturing Scrolled Content Correctly for PDF Export
I am trying to export visible parts of a webpage to PDF using JavaScript. My content includes elements like tables and charts that often have scrolled views. I've attempted to use both html2canvas and ...
0
votes
0
answers
145
views
html2canvas issues chrome extension
I am trying to use the html2canvas within a chrome extension I am building.
For my chrome extension I am directly injecting JS so that the user can toggle the extension so it does not go out of focus ...
0
votes
2
answers
97
views
How to set dpi on jpeg image download?
$("#download-pdf-template").on("click", function(e) {
overallwidthcover = parseFloat(Number(overallwidthcover).toFixed(3));
overallcoverhegiht = parseFloat(Number(...
0
votes
0
answers
176
views
box-shadows with html2canvas
I'm trying to use html2canvas library (version 1.4.1) with React 17 to download html as a picture and pdf. I think there is a problem with box-shadows.
Here is the code I use to download pictures and ...
-1
votes
1
answer
84
views
How to save a Wordpress page to my server with an iframe embedded in it
I have a Wordpress site that has a configuration product with a 3d iframe in it. When they use the page and design what they want via applying materials to that 3d image and selecting other variations ...
5
votes
1
answer
194
views
html2canvas 1.4.1 screenshot error element using background-image:data:image/svg+xml;base64,
I use the html2canvas library to capture screenshots by passing in a className and saving the image file as a blob. However, when the image is saved or downloaded, there is an issue with elements that ...
1
vote
2
answers
206
views
Page is getting unresponsive while generating the export pdf button
Page is getting unresponsive while exporting the page into pdf, refer the below screenshot.
Here is the stackblitz code: The below code is used to convert the chart into image which is causing the ...
0
votes
2
answers
147
views
html2canvas doesn't capture text in textarea in SVG
I am working on an Angular node-based application, the nodes in which are html tables containing <textarea>. When I try to generate project previews using html2canvas, neither the text in <...
0
votes
2
answers
84
views
jspdf multiple divs rendering empty
I am using jsPDF and want to generate content from multiple divs. My JavaScript is detecting the divs but is rendering them empty.
Why is that?
Here is my code:
const { jsPDF } = window.jspdf;
const ...
0
votes
0
answers
62
views
SVG rounds edges with large stroke-width
I met a problem during sankey diagram generating with d3 and screenshoting it with html2canvas.
D3 looks fine with this code of links:
<svg id="svg" width="740" height="400">
<g fill="...
0
votes
1
answer
350
views
Use of html2canvas in pdf-lib with JavaScript
Hi I have a few questions regarding the use of html2canvas. I am learning JavaScript and I am making a platform that helps to provide budgets that are downloaded in PDF format. I need the html2canvas ...
0
votes
1
answer
411
views
Html2canvas push text outside of con
I have a simple div with a paragraph in it.
when the pdf is generated, the paragraph is pushed down outside the div
I'm also using DaisyUI
<div class="bg-blue-50">
<p class=&...
2
votes
0
answers
116
views
Download PDF Failing
The following urls set in the BrowserComponent uses JavaScript to converts HTML to a PDF which can be downloaded by clicking a button.
This works in a web browser, but it doesn't download in Codename ...
0
votes
1
answer
187
views
Set background color of canvas with html2canvas
I'm using html2canvas to take screenshots from elements in a page
html2canvas(element).then(canvas => canvas.toDataURL());
Works find, but the only thing that goes wrong is that the background ...
0
votes
2
answers
600
views
Import module ts: Uncaught TypeError: Failed to resolve module specifier "html2canvas". Relative references must start with either "/", "./", or "../"
This is my first time doing a webapplication and therefore my first time using typescript / javascript / node modules. I'm using Webstorm and vanilla html, css and typescript.
Everything went fine so ...
0
votes
2
answers
488
views
html2canvas download the image like desktop view instead of mobile view for dom content reactjs
In reactjs I am using html2canvas library to capture the screen and download it as an image. Here is the code
const generateImage = async () => {
const element = contentRef.current;
const ...
1
vote
1
answer
213
views
Angular 18 html2canvas changes default Url. Causes lazy load components not to load
I have been generating PDF with Html2canvas for the las 12 months. I resently upgrade to Angular 18. I changed all components to standalone. However when generation a pdf (the generating pdf worked ok)...
1
vote
1
answer
117
views
Draw dashed border/outline around nontransparent part of image on canvas
I'm drawing an image onto a canvas and trying to apply red dashed outline of approximately 2px but end up with solid red outline. The source image is a .png image with top and bottom texts as part of ...
0
votes
1
answer
85
views
Why does my div with external image source download incorrectly
I am working on a project and I am so stuck. I need help.
Overview of the project: I am building a project that takes in a web address, goes to the web address, gets all of the images links in that ...
1
vote
1
answer
81
views
jsPdf when working in medium screen like(laptop) works fine but downloaded pdf from monitor screens not coming aligned properly
This is the below code where I am using html2canvas to convert html to pdf . Here pdf download in medium screens downloading as per expected but when same is rendered from large screens. In pdf few ...
2
votes
0
answers
138
views
Jspdf & Html2canvas -Image cut off while pdf contents "multiple" pages
I need to generate PDF from my web site page.
I have used JSPDF and HTML2Canvas for the same.
When I have tried to generate the PDF with large amount of data and image it has split image in 2 diffrent ...
0
votes
1
answer
177
views
Background color shifting in html2canvas img and pdf react
React JS
I am using html2canvas to convert a div to image and then pdf, however in the image and pdf view the background color of elements is shifting and hence the bottom part of text is being ...
0
votes
0
answers
113
views
How to save a div into the DB without canvas size limitations?
I am trying to build a tool where it is possible to create your own personal poster. The users can modify their poster with different images, colors, text, ... All of it is contained in a single <...
0
votes
1
answer
164
views
Charts are not displaying in export pdf
Please refer below example:
https://stackblitz.com/edit/angular-ivy-eqvhys?file=src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,package.json
Pleas help me to ...