Hi,
How do we convert HTML to PDF using conversion service without any margins in PDF?
Thank you in advance
-Mayuresh
Hi,
How do we convert HTML to PDF using conversion service without any margins in PDF?
Thank you in advance
-Mayuresh
Hello @mayureshvaidya,
Please provide more details:
Hi DmitriiV
Additionally adding water mark
I hope this information is good?
Regards
-Mayuresh
Could you please still provide a sample HTML file that reproduces the issue when converted?
Hi,
I am not allowed to upload files, so adding the html code below:
<html><head><meta charset="utf-8"><meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"><style>@body {margin: 0;size: A4;}</style></head>
<body style="margin:0px;padding:0px">
<footer>
<table border="0" width="100%" height="100%">
<tr><td height="780px"></td></tr>
<tr><td></td>
<td width="100"><img src="../files/singatures/017838bb-2f06-4b2c-84c0-f171c6b3a756/signature.png" width="100" height="50"><br />Admin User</td>
</tr>
</table>
</footer>
</body>
</html>
Regards
-Mayuresh
Hello @mayureshvaidya,
I haven’t been able to repoduce the issue so far on 8.3.2 version of the Document Server converting from .html file filled in with the above-provided html content, please try converting once again with a simple request (and use the latest Docs version) and check if the issue reoccurs:
{
"async": false,
"filetype": "html",
"key": "Khirz6zTPdfd7",
"outputtype": "pdf",
"title": "Example Document Title.pdf",
"url": "https://example.com/url-to-example-document.docx"}
Hi,
There was no issue while converting from DOCX to PDF, issue of margin is when converting from HTML to PDF.
Regards
-Mayuresh
Yes, the html file with html content was originally used for test, in the above-provided command the actual link led to .html file.
Please still upload the html file itself on which the issue is reproduced in your case (now you should be able to upload files)
Hi,
Sorry, the file you are trying to upload is not authorised (authorised extensions: jpg, jpeg, png, gif, heic, heif, webp, mp4, docx, xlsx, pptx, mkv, wmv, pdf, doc, xls, ppt, oform, docxf, docbuilder, odt, ods, lwp, csv, rtf, log, mov).
How to upload HTML file here?
-Regards
Mayuresh
Understood. You can upload it to some file server such as Dropbox and provide us the link
Hi,
This is the HTML file content. There is nothing else in that file. Is it not possible to copy & save this code in HTML and test?
<html><head><meta charset="utf-8"><meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"><style>@body {margin: 0;size: A4;}</style></head>
<body style="margin:0px;padding:0px">
<footer>
<table border="0" width="100%" height="100%">
<tr><td height="780px"></td></tr>
<tr><td></td>
<td width="100"><img src="../files/singatures/017838bb-2f06-4b2c-84c0-f171c6b3a756/signature.png" width="100" height="50"><br />Admin User</td>
</tr>
</table>
</footer>
</body>
</html>
Let me know.
-Regards
Mayuresh
That has already been tested. There are no margins after the conversion of the .html file to pdf. Although, just in case I also tested conversion of .html file to docx and then the margins appeared
Hi,
Attached PDF file which is directly converted from HTML. You should be able to see the margins.
I want to remove those margins. You already have the HTML code in earlier message.
Let me know how.
Regards
-Mayuresh
signature.pdf (36.5 KB)
I cannot see any margins in this file when opening it either in our Editor or in Adobe Acrobat, here are the screenshots:
Onlyoffice Docs 8.3.2 -
Adobe Acrobat
Where do you open this file?
Hi
I have marked the margins (extra space) which is being added automatically. The signature needs to be closer to the righthand side and near bottom, but there is significant space being added while converting from HTML to PDF.
-Regards
Mayuresh
Thank you for the clarification, sorry for earlier misunderstanding, we are checking the situation
Conclusion: Actually, this behavior is the default behavior when converting either from html to docx or from html to pdf, the margin depends on the page format. The only recommendation here is to convert to docx first, adjust the margins manually, export as pdf. Sorry for the inconvenience, there is no other way for now