Also, you may want to have us take extra time for the conversion so that the page is fully loaded before the PDF is created.Īll this is possible with the parameters below. You may want to select the print layout for example, or hide/change part of the layout. But the layout sometimes needs a little tweaking, because a PDF is a different output medium than a monitor. So if you want to use Letter as the output page size, then you could use the following API call.īy default we try to convert the webpage (or HTML) to PDF exactly as it would look on screen. The following is a list of page sizes that are pre-defined and that are available to be used as page_size. This is the unit for the custom width, height and margins. Mm millimeters (this is the default) cm centimeters in inches px pixels Top margin - you need one if you want to display a headerīottom margin - you need one if you want to display a footer One of the standard page formats from the table below. Page size, orientation and margin options Parameter We have many different standard page sizes, but you can also define your own page size by using the width and height parameters. You can change the size, orientation and margins of your PDF by adding the parameters from the table below to your API call. Setting default options for the HTML2PDF API. Still, if you need to set specific options for certain API calls, then you can override these by adding parameters to the API call as described in the sections below. Once you've set these defaults, they will be used for all API requests from that point on. Setting OptionsĪll our API options can be quickly set in our members area with an easy-to-use WYSIWIG screen, which is shown below. You can use both GET as well as POST requests to call our API. If instead you'd like to convert some HTML to PDF, then you should use the html parameter like in the below request.Īs you can see you need to make sure you pass the URL or the HTML in a URL encoded form so that it arrives properly on our end. That's all there is to it! This request will return a PDF of the URL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |