Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Giving margin while converting HTML to PDF

New Here ,
Jun 25, 2020 Jun 25, 2020

How can we set margins in the PDF during conversion from HTML file>

776
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 06, 2020 Oct 06, 2020

Thanks for reaching out. As of now we do not support setting custom margins in the PDF document through our SDKs. At the moment you can only provide custom height and width while converting your HTML to PDF document ( refer this sample for the same :- https://github.com/adobe/pdftools-java-sdk-samples/blob/master/src/main/java/com/adobe/platform/oper...)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2024 Jun 01, 2024

We are using html to pdf to create business cards which are 3.5in x 2in. The hard corded margins are something like .5 inches and so we have very little room for the content on the business card. Can we please have an update that allows us to specify a custom margin size? Or, if that is too much to ask, can we please have an automatic margin size that adjusts down to something like .25 inch if the page size is smaller than 3in x 5in?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2024 Jun 21, 2024
LATEST

Okay kids, we solved this problem by creating our PDF with width and height that is 4 times the true size, which winds up giving us the equivalent of 1/8 inch margins. This is because our PDFs are business cards and when you load them into a print job they get shrunk to 1/4 the size to fit onto a standard business card. So there you go - just hack it!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources