Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return false when add marginTop() in HtmlToPdf #54

Open
alohadance98 opened this issue Oct 31, 2022 · 1 comment
Open

Return false when add marginTop() in HtmlToPdf #54

alohadance98 opened this issue Oct 31, 2022 · 1 comment

Comments

@alohadance98
Copy link

Hi,
I want to add margin to PDF file but it's always return false, here is my code
boolean success = HtmlToPdf.create().marginTop("15px").object(HtmlToPdfObject.forHtml(content)).convert(pdfFilePath);
Everything is normal if i remove marginTop()

@Xstream007
Copy link

I found a solution. Instead of setting "15px", set "15". That is -

boolean success = HtmlToPdf.create().marginTop("15").object(HtmlToPdfObject.forHtml(content)).convert(pdfFilePath);

This works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants