PDF for Cloud - Document Margins


#1

Hi there,

I’m creating a PDF from an HTML template and I need to set the PDF margins. How can I do this?

In my REST PUT request I’m sending as a content:

{“PageInfo”:{“Margin”:{“Bottom”:10,“Top”:20, “Left”: 5, “Right”: 5}}}

But it’s not working. I always get the PDF with the same (big) margins.

Please help.

Thank you!


#2

@praydesai,

Thanks for contacting support.

We are working on testing the scenario using our sample HTML documents and will keep you updated with our findings.


#4

Hi

Any progress on this?

I have a customer waiting.

Thanks in advance!


#5

@praydesai,

Thanks for your patience. We are in the middle of testing and hope to share our findings, shortly.


#6

@praydesai,

Thanks for your patience.

After further investigation, we have found that currently Aspose.Pdf for Cloud do not support the feature to set page margin when converting HTML files to PDF format. For the sake of correction, I have logged this requirement as PDFCLOUD-52 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

As a workaround, you may consider setting Left and Right margin for input HTML file


#7

I tried:

body {
font-family: Arial, sans-serif !important;
font-size: 16px;
margin: 0 !important;
padding: 0 !important;
}

But the final result is the same.


#8

@praydesai,
Kindly send us your complete code of Aspose for Cloud API request along with the source PDF document. We will investigate and share our findings with you.


#9

Hi,

So these are my request details:

Provider url: http://api.aspose.cloud/v1.1/pdf/

Connector Url: ${target_pdf_file?url}?templateFile=${template_html_file?url}&templateType=html&appsid=${app_sid}&signature=${signature}

Method: PUT

Result format: JSON

Content: {“PageInfo”:{“Margin”:{“Bottom”:10,“Top”:20, “Left”: 5, “Right”: 5}}}

Content type: application/json

Please see attached HTML template.final_pdf_template.zip (1.7 KB)


#10

@praydesai,
We are working over your query and will get back to you soon.


#11

@praydesai,
We have logged a feature request under the ticket ID PDFCLOUD-52 in our issue tracking system and you will be able to set page margins once it is resolved. We will notify you once a significant progress has been made in this regard.


#12

Thank you so much!


#13

Hello,

My customer requires an update on this issue, they are complaining about the amount of paper wasted due to the big margins.

Can you share a release date for this new feature?

Thank you!


#14

@praydesai

Our Product team is working on this issue and I will let you know as soon as they fix this issue. Thanks for your understanding and have a good day.