Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
111 views

simple web app to use for pdf chunking I’m using the pdf-lib npm package to crop and manipulate PDF files. My goal is to: List item. Crop multiple horizontal slices from each page. Re-export those ...
Crow V's user avatar
  • 59
0 votes
0 answers
123 views

I'm building a custom React-based PDF editor and signer using react-pdf and pdf-lib. The editor (PdfEditor.tsx) lets users drag-and-drop fields (Signature, Email, Date, etc.) on a PDF canvas. Later, ...
KINETIC's user avatar
  • 33
0 votes
1 answer
186 views

I'm building a React Native Web app using Expo and the Metro bundler. I've implemented a PDF generation feature that processes a large amount of tabular data. The issue is that generating the PDF ...
Sohaibs Amir's user avatar
1 vote
0 answers
85 views

I'm working on a PDF form where I need to restrict a multiline text field from being overfilled. The idea is to prevent users from entering more text than the field can visually accommodate. However, ...
mr_dschingis's user avatar
1 vote
0 answers
80 views

Maybe my whole approach is wrong. I trying to simulate a signer filling a field after the pdf has been certified (digital signature). What I attempted: changing its value using SetValue, making a copy ...
Bobby-1995's user avatar
0 votes
0 answers
66 views

I am working on a Next.js project that uses the pdf-lib library to generate or modify PDFs, and I'm using @pdf-lib/fontkit for font support. Locally, everything works fine, and the application builds ...
Mixko's user avatar
  • 633
0 votes
1 answer
202 views

I'm working on generating and inserting data into the existing pdf, and applying font size and font family to the text field of PDF. this is my code snippet to attach the font. const { PDFDocument, ...
omkar p's user avatar
  • 63
0 votes
0 answers
47 views

I am working on a pdf annotation I'm using pdfjs and PDF-LIB,I want to add numbers in the pdf canvas and on click delete is it possible to use click events inside the pdf viewer I have tried overlayg ...
adrian thuo's user avatar
0 votes
0 answers
58 views

const filePath = path.join(pdfFolderPath, file); // Read the PDF file const fileData = await fs.readFile(filePath); // Load the PDF document const pdfDoc = await PDFDocument.load(fileData); const ...
chichi's user avatar
  • 3,340
2 votes
1 answer
478 views

In pdf-lib, it is possible to auto-word-wrap text using a technique outlined here: https://stackoverflow.com/a/77436904/1766230 import { PDFDocument, StandardFonts } from 'pdf-lib'; const doc = await ...
Luke's user avatar
  • 20.3k
0 votes
0 answers
52 views

I am working on an Angular application where I need to render an existing fillable PDF using pdf-lib. The PDF can have some pre-filled data, and users are allowed to edit this data or fill in new ...
jijo's user avatar
  • 845
3 votes
0 answers
460 views

This works form.getTextField("name").setText("John Doe"); // This does not work form.getTextField("name").setFontSize(12).updatedField.setText("John Doe"); ...
chichi's user avatar
  • 3,340
0 votes
1 answer
350 views

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 ...
Franco Kohler's user avatar
0 votes
1 answer
298 views

Does anyone know if there is a way to modify a text written in drawtext with the pdf-lib library or another library that I can use in script apps? I wrote this code: setTimeout = (func, sleep) => (...
Diego-31's user avatar
-1 votes
1 answer
547 views

I would like to create an editing interface where the textInputs are filled in on the server side. It would be necessary to set the background of the fields to transparent, but I couldn't find a ...
Csaba Kovács's user avatar
1 vote
0 answers
329 views

I'm working on a project where I need to programmatically fill out and save PDF forms using pdf-lib. I've encountered an issue specifically with conditional form fields—such as radio buttons and text ...
Tharindu Lakmal's user avatar
0 votes
1 answer
96 views

I am trying to download a pdf and then merge it using pdf-lib in nodejs. The pdf is being merged and I am getting total of 8 pages 4 pages each the problem is the pages are blank. The same thing I ...
Namit Piriya's user avatar
0 votes
1 answer
236 views

I'm using PDF.js Adding references straightforward <link rel="resource" type="application/l10n" href="/locale/locale.json"> <script src="build/pdf.js&...
Developer's user avatar
1 vote
0 answers
76 views

I have a Laravel website. I need a pdf viewer that can also add handwritten signatures. I found PDF-LIB as a pdf editor. But the website only explains how to edit using hard code. I need a user ...
Muhammad Nafis's user avatar
0 votes
1 answer
478 views

I am using pdf-lib in my React TypeScript app. How can I get all the text fields in a PDFDocument with the page number on which that form field is. const getAcroFieldRefs = (pdfDoc) => { if (!...
Shahid Nauman's user avatar
2 votes
1 answer
547 views

I am trying to add links to a PDF document using the pdf-lib JavaScript library. When I open the PDF in a browser and click on a link, it opens the website, but it does so in the same browser tab. I ...
Gurami Tchumburidze's user avatar
2 votes
1 answer
2k views

I am attempting to add a custom font to the pdf-lib library, but I am encountering an error: 'Unknown font format.' I have tried TTF, OTF, WOFF, and WOFF2 fromats, but none of them seem to work. Could ...
Gurami Tchumburidze's user avatar
0 votes
1 answer
134 views

I tested this code to test by text fields: PDFWriter.prototype.encrypt = function (ref, obj, pdfSecurity) { let encryptedData; const encryptFn = pdfSecurity.getEncryptFn( ref.objectNumber, ...
Mustapha BOUFARA's user avatar
0 votes
1 answer
350 views

I need to get the properties value of "Export Value" out of checkbox fields in PDF file, I using 'pdf-lib', and according to the code in the repo I should get it by using: const pdfDoc = ...
Itay Ariely's user avatar
0 votes
1 answer
231 views

I'm facing an issue with my lambda function. When I run it in Postman, the PDF isn't displayed. I've also tried the 'Send and Download' option, but it says the file doesn't have a valid format. Any ...
tosa's user avatar
  • 83
1 vote
2 answers
703 views

I created a valid pdf with a single blank page and an existing text field, everything is fine: I can edit the pdf and save it, everything is fine. I tested the pdf with tools for validation, the pdf ...
Mustapha BOUFARA's user avatar
1 vote
0 answers
1k views

I need your help guys, I am currently working on a PDF editor using pdf.js and pdf-lib, I am using the pdf.js to render the pdf on a page within my application and the pdf-lib strictly for modify and ...
Gabriel J's user avatar
0 votes
0 answers
482 views

I have created a function for crop a pdf page const existingPdfBytes = await fs.promises.readFile('input.pdf'); const existingPdfDoc = await PDFDocument.load(existingPdfBytes); const pdfPage = ...
Ashish Mishra's user avatar
0 votes
1 answer
1k views

im using pdf-lib.js lib but im having troubles, this code was working but some day give me that error Note: the pdf is in the same route when i press the button the pdf get downloaded but without any ...
TaquitoLoverDev's user avatar
0 votes
0 answers
250 views

I have a pdf that has a field with javascript that concatenates two other fields into it. When using pdf-lib and using setText for the two other fields, the field with javascript doesn't get triggered ...
user3295797's user avatar
2 votes
0 answers
662 views

const fontPath = path.join(process.cwd(), 'src/fonts/arial.ttf'); const fontBytes = await fs.readFile(fontPath); pdfDoc.registerFontkit(fontkit); const customFont = await ...
Dilshan's user avatar
  • 61
2 votes
2 answers
7k views

I have what seems like it should be a simple problem - I would like to be able to fill out PDF forms programmatically in javascript. My first attempt was with pdf-lib which has a nice API for filling ...
Tim's user avatar
  • 1,255
1 vote
1 answer
527 views

I have this form standard form of lease and i need to fill this with dynamic values using javascript. I tried using pdf-lib to get all the fields but it gives me empty array with some warning Trying ...
SathiyaNarayanan's user avatar
0 votes
1 answer
2k views

I am trying to change the font style and font family for the signature field in my PDF using PDF-Lib library in nodejs.Here is my code , but I am unable to change the font. const {PDFDocument, degrees,...
Muhammad Muneeb Waqas's user avatar
0 votes
2 answers
60 views

I'm using the pdf-lib package in a TypeScript project and wrote some wrapper code to use it in test automation. It worked fine. We decided to push this wrapper code to a shared project so others ...
Kevin McDowell's user avatar
1 vote
0 answers
66 views

project: certificate generator I have a certificate template.png file in the folder directory. Link for the template file: https://drive.google.com/file/d/1UgYkO-VOXvCUjBkdbSEDOGVd8szZXZ0z/view?usp=...
Abijith's user avatar
  • 43
1 vote
1 answer
890 views

I am trying to draw an image in a pdf with PDF-Lib. My purpose is to draw it in full size in a page of 6cm x 11.3cm. I made the math conversion, if i want 300 DPI, it correspond to 780px x 1406px. I ...
Foxhunt's user avatar
  • 984
0 votes
1 answer
1k views

I am trying to load a font for pdf-lib to use. In order to use it, i must provide a Uint8Array for pdfDoc.embedFont(font); For some reason, whenever i create the UInt8Array, it returns empty. The ...
skelyvelocirap's user avatar
0 votes
1 answer
1k views

I have two checkboxes in my PDF. They are "Ja" & "Nei". But when I use const fields = form.getFields() this property to get checkbox names im getting only name===> ...
Damitha Perera's user avatar
0 votes
1 answer
3k views

I currently have PDF-Lib successfully creating a generic pdf that I'm able to view & download on my pc's browser by using an iframe or using PDFObject to put it within a div. When viewing on a ...
Dom's user avatar
  • 878
-1 votes
2 answers
131 views

I am trying to merge two canvases, each of which contains an identical PDF document except for a signature pad. My goal is to combine both canvases to merge the signature pads into one document. ...
srecce's user avatar
  • 97
1 vote
0 answers
327 views

guys. I am working on documents signature implementation. It have few steps: User see PDF file and should tap on the place where signature should be placed. On this step I'm using https://github.com/...
Stas Motorny's user avatar
1 vote
1 answer
662 views

I generate a PDF document using the following code snippet and it is kept loaded to a HTML iFrame. Then user can download it if required. I want to set the document number as the default file name. ...
Lakshitha Kanchana's user avatar
0 votes
0 answers
181 views

I need to convert a PDF data array type buffer into an ArrayBuffer. here's an example this.templateService.get(data[0].templateId).subscribe({ next: async (data) => { this....
meth's user avatar
  • 99
2 votes
1 answer
2k views

I am using pdf-lib to draw some text on top of an existing PDF page. If the text is too long to fit in the area designated, I want to add the entire text to a Sticky Note Annotation, so the viewer can ...
Ryan Griggs's user avatar
  • 2,808
0 votes
1 answer
922 views

PDF has stored rotation value which is multiple of 90 degrees. I want to reset the value to 0 without actually rotating it. Is there any way to do that by programmatically? If possible, I want to use ...
Shun.Tagami's user avatar
1 vote
0 answers
1k views

I tried to add png image in nest.js using pdf-lib import { PDFDocument } from 'pdf-lib'; import * as fs from 'fs'; const existingPdf = await fs.readFileSync( './agreements/...
Aleks Daddario's user avatar
2 votes
0 answers
470 views

The names for the pdf fields currently are hard to know where each field is on the form and what's what so I wanted to either change the name of some of the fields that don't make sense or make the ...
Harshitha's user avatar
0 votes
0 answers
81 views

I used pdfjs to split the pdf files, then add some watermark(the watermark string contains some Chinese). Finally, generate a new pdf file for browsing. Strangely, some of the text appears incomplete....
Jerry Don's user avatar
2 votes
1 answer
3k views

Currently implementing the PDF-Lib Library for my project to modify PDFs Source: https://pdf-lib.js.org/#examples And it is working very well, but the modified PDFs are saved on the server. I am ...
JrWebDev's user avatar
  • 126