Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
Removal / Cropping of margins on pdf documents | Node / Javascript

Trying to tackle the scenario where a PDF is a given input. The PDF has a page margin around its content and when this input PDF is compiled in to another document, which has its own resulting margins, the final appearance is off because now the content within the PDF has a "double margin", making the input pdf content smaller.

The goal is to remove margins in an input pdf BEFORE including it in the process that spits out a final document.

I have looked into node modules such as pdf-lib as to hopefully be able to crop a pdf correctly, but when most of the documents that come through seem to have all the same values for its mediabox, artbox, bleedbox, cropbox, etc... it doesn't really give us a jumping off point on how to correctly recrop this pdf. Since all the values of the previous boxes are (0,0, width of document, height of document), there is not much to go with to find where the content is starting

The hope is to do this all server side with out the need for a user to manually fix the issue.

Has anyone tried to tackle this sort of process? Thoughts? Breakdown the pdf ( which could contain almost anything ) with something like pdf2json module and create a new document with pdf-lib ?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!