Hopding / pdf-lib

Create and modify PDF documents in any JavaScript environment
https://pdf-lib.js.org
MIT License
6.74k stars 645 forks source link

Unexpected Checkbox Borders on Print After Editing PDF with pdf-lib #1546

Open MrBetatester opened 9 months ago

MrBetatester commented 9 months ago

What were you trying to do?

I have a customer PDF in which I enter text into PDFTextField and add entries to PDFDropdown and select them. As seen in the image, the customer has not defined borders for checkboxes. After the editing of the PDF by pdf-lib, these are still set to no borders, but when printing, it prints borders around the checkboxes. When I print the customer's template, I get no borders.

How did you attempt to do it?

I load the PDF only once at the start and create a copy multiple times like: `
var contractPDF = new ASPDF(); function init() { await contractPDF.load("contract.pdf", true); }

async function test() { var contractPDF = new ASPDF(); await contractPDF.load("contract.pdf", true);

var pdf = await contractPDF.copy(); await pdf.fillForm() await pdf.get("Contract_123.pdf", PDF_DOWNLOAD); } ` as_pdf.zip

What actually happened?

I am attaching a screenshot of the printed result showing the unintended borders around the checkboxes for reference. Print CheckBoxSettings

What did you expect to happen?

My primary expectation upon modifying the customer's PDF with pdf-lib was to maintain the original design elements during printing, particularly for checkboxes.

How can we reproduce the issue?

You can use the ASPDF class to load the PDF with checkboxes, which are configured according to the settings shown in the screenshot. Download the file using the provided code; however, after printing, borders will appear around the checkboxes.

Version

1.17.1

What environment are you running pdf-lib in?

Browser

Checklist

Additional Notes

No response