Skip to main content
Participant
April 26, 2021
Question

Html to PDF adds a white margin around the page

  • April 26, 2021
  • 1 reply
  • 792 views

Hi,

 

I tried to use Adobe's document service API to convert HTML to PDF. But the generated pdf always has a white margin around each page. I don't see any options to scale the HTML to the whole page. I tried the PageLayout options, where you can specify height and weight, but it won't remove the margin.

 

Is there any way to remove the while margin. Otherwise this tool won't satisfy our requirements.

 

Chaoran Yng

    This topic has been closed for replies.

    1 reply

    Participant
    May 26, 2021

    I  thought I had replied to this post, but maybe not. 

     

    On : https://opensource.adobe.com/pdftools-sdk-docs/release/latest/howtos.html#create-pdf-with-documentlanguage

     

    under the "Create a PDF from static HTML" heading, you can try setting the PageLayout like in the setCustomOptions method. That may help w/ this issue. I saw that recommended somewhere online.

    Participating Frequently
    November 6, 2024

    hii, how we can remove page margin is there any cropping api or can we set margin in html to pdf conversion api.if you have any solution please let me know the syntax of rest api.i had tried multiple methods but didnt get desired result .my pdf file is generated sucessfully just adding white margin around every page i want to remove it,