2,575 questions
2
votes
2
answers
104
views
How can I display the Persian language fonts?
I use my custom Persian font in jsPDF, but characters for this font show me wrong.
I hear
The IranNastaliq font uses the 'cswh' feature for such ligatures. 'cswh' is default-off according to the ...
1
vote
1
answer
53
views
Text overlaps and resets position when rendering multiple text chunks in a loopHow
I am building a client-side application ("SpeakFlow") that takes large PDF files, processes the text in chunks using an LLM to generate Markdown, and then compiles those chunks back into a ...
1
vote
0
answers
135
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 ...
0
votes
1
answer
65
views
How do jspdf transformation matrices work?
I am using transformation matrices with jspdf to change the origin and scaling of my drawings. setCurrentTransformationMatrix has no official documentation from what I found (well, except if "...
0
votes
0
answers
65
views
links in HTML text in jspdf
I'm using jspdf to render text that I get from a text editor (which means the text has HTML tags and styles and classes), i'm using the method .html
when the note is basic text and it's working fine, ...
2
votes
1
answer
93
views
jsPDF adds image at incorrect size and position when using dimensions from getBoundingClientRect and clientHeight/clientWidth
I am trying to add an HTMLElement to a PDF after converting it to an image using "toPng" from "html-to-image".
The HTMLElement exists inside another, that plays the role of the ...
2
votes
2
answers
163
views
Error on trying to use jsPDF in tampermonkey. Saying jsPDF object is undefined
Ive been writing a tampermonkey userscript to convert an ebook to a pdf in google play books. However, whenever i try to use the jsPDF object, it throws an error. This is my the part of the code that ...
0
votes
0
answers
58
views
Highcharts area line color on jsPDF
I am trying to plot an area chart SVG into a pdf, but for some reason the line on top of the area insists in being grey.
I tried giving the colour in hexadecimal, also giving a line as well as area ...
0
votes
0
answers
201
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. ...
1
vote
1
answer
109
views
jspdf Tahoma Font rendering different from other PDF
To use the Tahoma font in my PDF I loaded the TTF file from my Windows/Fonts folder into a converter which holds a Base64 string as input to the jsPDF plugin.
Now the results show different from ...
1
vote
1
answer
193
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&...
0
votes
2
answers
46
views
Make HTML content sheet adapt better to mobile layout
I have only very basic HTML knowledge and would appreciate input from those with better HTML knowledge.
I have a simple HTML file for entering a content list which is editable online and then ...
0
votes
0
answers
61
views
Kannada support in jspdf
I am trying to download the pdf with kannada fonts.
I downloaded the NotoSansKannada-Regular.ttf file and converted the file to .js using tool https://rawgit.com/MrRio/jsPDF/master/fontconverter/...
1
vote
1
answer
74
views
Text not displaying calculated numbers in PDF where console logging correctly
I am using jsPDF in a Vue 2 project to generate a PDF report. The issue I’m facing is that my calculated numbers are not appearing in the generated PDF, even though they print correctly in the console....
0
votes
0
answers
91
views
I can't load the jspdf script in my content.js script in Google Chrome extension
Context
Hello, I'll start saying that I'm sorry if my code sucks, I am a backend dev, not a frontend, I know a little of JS.
Btw I am trying to do this Chrome extension with manifest V3 that basically ...
0
votes
1
answer
141
views
Arabic Headers in jsPDF AutoTable Appear as Garbled or Corrupt Text
I am using jsPDF with jspdf-autotable to generate a Right-to-Left (RTL) PDF report in Arabic.
Everything works perfectly, but the headers appear as garbled/corrupt text instead of proper Arabic ...
0
votes
0
answers
66
views
jsPDF get access to row data on different pages
Is it possible to get access to row data on specific page?
I tried willDrawPage or didDrawPage - but it still shows like all data, all rows in one object
I need to create structure like:
{
page1: ...
0
votes
0
answers
159
views
Issues with downloading PDF using jsPDF on Android via WebIntoApp: No default filename/extension and file not visible in Downloads folder
I'm encountering two issues when using jsPDF in a web application that I transformed into an Android app using WebIntoApp. Here's the relevant code snippet:
<html lang="it">
<head&...
0
votes
1
answer
135
views
Rotated, center aligned, multiline text in JsPDF
I'm using JsPDF to generate some documents.
I need a piece of text to be rotated 180.
It has a max width so it's multiple lines.
It also needs to be center aligned.
Currently i'm doing this:
doc.text(...
0
votes
0
answers
146
views
Icons misaligned in React PDF generation using html2canvas -alignment differs between preview and generated PDF
I'm using html2canvas to generate a PDF from a React resume template. While the icons are perfectly aligned in the HTML preview, they become misaligned when converted to PDF. Here's my setup:
I'm ...
0
votes
1
answer
172
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
76
views
How to dynamically adjust this image for this PDF such that the image is directly below the text?
In this code, I need to adjust the code such that the image is directly below the text. When I run this code,
Here is my current code:
var pdf = new jsPDF('p', 'pt', 'letter');
let w = 40;
let h = 100;...
0
votes
0
answers
78
views
jsPDF 2.5.2 - letter spacing for numbers with font Montserrat
I use the Montserrat Font for creating PDF's with jsPDF 2.5.2 and I need letter spacing for numbers.
For my website it works when I add: font-feature-settings: "tnum"
@font-face {
font-...
0
votes
0
answers
118
views
How to Center and Scale Images Proportionally in a PDF Using jspdf Without Quality Loss?
I want to display images within a PDF using jspdf, but I am facing an issue with how the images are being rendered.
Issue:
The image is covering the entire div in the PDF.
Desired Result:
The image ...
0
votes
1
answer
99
views
I can't print on half an A4 sheet
In Jspdf, i need to print half an A4 sheet in portrait orientation.
This is my code:
let doc = new jsPDF({
orientation: 'portrait',
unit: 'mm',
format: [210, 148.5],
});
This causes the ...
2
votes
2
answers
2k
views
Fonts not applied in generated PDF using jsPDF from HTML content
I am trying to convert my HTML content to a PDF using the jsPDF library. The HTML file contains custom fonts that are defined using @font-face with Base64-encoded font URLs. However, when I generate ...
1
vote
0
answers
90
views
How can I capture a screenshot of an offscreen (non-visible) map using the react-map-gl and @deck.gl/react libraries?
I am working on a React project where I use the react-map-gl and @deck.gl/react libraries to display a map along with DeckGL layers on the screen.
I have added PDF printing functionality to the ...
2
votes
0
answers
121
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
302
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
111
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
0
answers
59
views
jsPDF Center Text Alignment Doesn't Work with setCharSpace
I am using jsPDF in a project and mostly have things working as expected. If, however, I decide to change the default character spacing to any non-zero value, centering gets thrown off by the ...
0
votes
0
answers
131
views
JSPDF Get Page Information for How much Content is Filled in Current Page
Hi I am having dynamic html content to print this on jspdf I am using its HTML Function so it wont break on the next page
await pdf.html(tempContainer, {
callback: async(pdf) => {
},
...
0
votes
0
answers
166
views
JSPDF HTML to PDF I am having issue on bold placement missing alingment
**For dynamic data I am using creating HTML **
<div class="prv-blk" id="content-to-print">
<p style="page-break-inside: avoid;"><b&...
0
votes
2
answers
223
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
166
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 ...
1
vote
0
answers
77
views
Error while using new jsPDF 2.5.2 in Laravel
I am working on my website project in Laravel, and I want to use the new version of jsPDF which is 2.5.2. Here is the js file I have:
document.getElementById('exportPDF').addEventListener('click', ...
0
votes
1
answer
124
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 ...
-1
votes
1
answer
261
views
jspdf fallback font for other language
We use custom font let's say sans that does not support chinese language. How do i add fallback option in the jspdf that it will not use sans font for chinese.
doc.addFileToVFS('custom-sans-normal....
0
votes
1
answer
281
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
575
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
1
answer
362
views
Adding SVG to PDF using jsPDF on server (using NestJS or NodeJS)
I am trying to insert a SVG to my PDF using NestJS and jsPDF. But I think jsPDF doens't have support for inserting SVGs on server. Is there any way around this someone has found? Would be really ...
1
vote
0
answers
157
views
jsPDF doc.save() generate pdf includes image in pdf is working fine but using doc.output() string image part generate as junk
doc.addImage(this.image, 'JPEG', 75, 15,57,23);
doc.text(20, 100, 'Subject : Notification');
doc.save('Test.pdf');
above code is working fine generated PDF string below, downloaded properly in local
...
1
vote
0
answers
137
views
does the scale should change with the Page scale in react pdf
I am using pdf.js to show some pdf file with react project, actually using react-pdf which wrapped the pdf.js. Now I am using scale like this to zoom in or zoom out the pdf:
<Page
key=...
2
votes
1
answer
70
views
Hide PDF content design component in Angular
I have two components. Billing component(User type the item details) and billpage component (Pdf page is designed and pdf is generated).
The item details from(billing.ts) are passed through service (...
1
vote
0
answers
160
views
How to download a Vue component as a PDF in Nuxt 3 without vulnerable packages?
I have a large hard-coded grid (more than 300 grid items) with many styles in my RiskGrid.vue component, which is located on the risk.vue page. The RiskGrid.vue component also contains smaller ...
1
vote
0
answers
49
views
jsPdf Export not Exporting class declared CSS
how do I apply a check on a class check?
I have the following html5 logic. My style applies the format to my razor page view.
I want to apply the css setting, can I add any ID fields into my somehow?...
0
votes
1
answer
311
views
How to use UTF 8 and special characters with jsPDF
I am using jsPDF to create a PDF file. Some text has special characters. For e.g. instead using H2SO4 I want to write H₂SO₄.
Does jsPDF supports it ? Can someone please suggest how to do it?
1
vote
0
answers
193
views
using html2Pdf library printing table header on every page
I’m using the html2pdf library to generate a PDF from an HTML table. The table spans multiple pages, but the header only appears on the first page. How can I make sure the table header is repeated on ...
0
votes
0
answers
54
views
Unable to use images with jsPDF
everyone,
I'm trying to create a pdf file with jsPDF but I need a logo at the top of the page.
I've tried a .jpg and a .png file bu I always get the erro that the file is not a .jpg file or a .png ...
1
vote
2
answers
202
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 ...