Simple service to render a single, or multiple URL's to a PDF with various options.
The base URL for the service is https://pdf.increo.no/render
.
GET
You can either add a single URL with the url
query-string, or multiple URL's by using the urls
with a JSON serialized list of URL's.
https://pdf.increo.no/render?url=https://vg.no
or
https://pdf.increo.no/render?urls=['https://vg.no','https://db.no']
POST
With POST
you can add the list of URL's as a body payload.
{ "https://vg.no", "https://db.no" }
You can apply various options by adding query-string parameters to the URL, whether you use GET
or POST
.
Use the filename
option to set the filename of the PDF returned.
If no filename option is specified DateTime.Now.Ticks
will be used.
The .pdf
will be automatically applied to the given filename.
Example: https://pdf.increo.no/render?url=https://vg.no&filename=test
By default the renderer renders to letter format.
You can set mediabox
to a4
to force it to render to A4.
Example: https://pdf.increo.no/render?url=https://vg.no&mediabox=a4
By default it should render a number of pages to match the length of the HTML document.
You can set the total number of pages with the limit-pages
param.
Example: https://pdf.increo.no/render?url=https://vg.no&limit-pages=5
By default it renders to portrait.
To render to landscape, use the landscape
param.
Example: https://pdf.increo.no/render?url=https://vg.no&landscape=1
You can use an already existing PDF file with fields to edit and fill the fields.
Example: POST https://pdf.increo.no/fields
Payload:
{ "url": "https://http.path.to/pdf.pdf", "fields": { "Header": "TEST-HEADER", "txt_bold": "THIS IS BOLD TEXT, AND UPPER CASE.", "txt_italic": "this text should be italic, and lower case." } }
Or if you just want to fill the fields in order:
{ "url": "https://http.path.to/pdf.pdf", "listOfValues": [ "value-for-field-1", "value-for-field-2" ] }
You can also specify a base64-string of the PDF instead of supplying a URL:
{ "base64": "your-base64-string-here", "fields": { "key": "value" } }