PDF.co HTML to PDF is a web-based tool that converts HTML pages or URLs to PDF files. This tool can be accessed through a web browser and does not require any software installation. Users simply need to enter the URL of the website or upload the HTML file they want to convert, and the tool will generate a high-quality PDF file.
Note: If you are a developer, check out our API docs here and explore over 300+ integrations here.
- Open PDF.co and Select Anything to PDF Converter
- Configure Anything to PDF Converter
- Test Action
- Copy & Paste URL to Browser to View Output
- Generated PDF Output
In this HTML to PDF tutorial, we will show you how to set custom Paper Size and Margin to a PDF document. We will use a Raw HTML Code as our Source Input to generate the Output PDF.
Step 1: Open PDF.co and Select Anything to PDF Converter
- To start, let’s set PDF.co as the App and Anything to PDF Converter as the Action Event.
Step 2: Configure Anything to PDF Converter
Anything to PDF Converter converts our HTML code to PDF. This is where we can also set up custom profiles. You can check out the custom profiles doc here.
- In the Input Type field, select Raw HTML code.
- In the Input field, paste the HTML code.
- In the Name field, type in your desired output filename.
- In the Custom Profiles field, enter the Margin’s 4 sides and Paper Size. Paper Size can be set to A4, Letter, custom size, etc. Check out our API docs here for other Paper Size options.
{ "profiles": [ { "profile1": { "Margins": "30px 10px 30px 10px", "paperSize": "A5" } } ] }
Step 3: Test Action
- We are now ready to Test & Review our data and send it to PDF.co.
Step 4: Copy & Paste URL to Browser to View Output
- PDF.co has processed our request and generated a temporary URL to access the result. Kindly copy and paste the URL to see the output.
Step 5: Generated PDF Output
- Excellent! We have converted an HTML code to PDF and set the PDF’s Margin and Paper Size according to our requirements.
Screenshot of Output Result
You can set up the next step to save the generated file in Google Drive or Dropbox depending on your requirement.
You just learned how to set up a custom paper size and margin for HTML to PDF or URL to PDF generation using PDF.co and Zapier. This is just one of the dozens of useful tutorials that we have for creating, converting, and customizing PDFs. Here are a few more others:
- How to process large files with PDF.co and Zapier;
- How to create PDF from scratch using PDF.co and Zapier
- How to make PDF invoice by adding text and images to PDF template;
- And many more.
Note: If you are a developer, check out our API docs here and explore over 300+ integrations here.