How to specify font using HTML to PDF Converter Cloud API?

Hi,

I'm using the cloud api to convert HTML to pdf. How can I specify the font that the PDF output should use? Can I specify the font using css in the html page itself?

Thank you,
Customer
-----------------------------------------------
Yes, of course, you can specify the font using CSS in the HTML page itself, this can be done easily in HTML code.

VeryPDF
-----------------------------------------------
This doesn't appear to be working, I don't get

* {font-family:"Times New Roman",Times,serif;}
...

It looks good in HTML but not in the PDF. Please see screenshot below (PDF is on the left with strange fonts, HTML on right with Time New Roman).

How do you recommend I specify the font?

Thank you,
Customer
-----------------------------------------------
We have fixed the problem in "html2pdf4" app, it can render your HTML page to PDF file properly now,

http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXXXX&app=html2pdf4
&infile=https://dl.dropboxusercontent.com/u/5570462/temp.html

but your HTML page is contain a long table, this long table will cross page1 and page2, "html2pdf4" app is not support this type of long table yet, so it will ignore this long table during rendering.

If you wish convert a long table from HTML file to PDF file, we suggest you may use "html2pdf" app. We have solved customized font problem in "html2pdf" app today, you can specify customized font by following CSS style,

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic' rel='stylesheet' type='text/css'>
<style>
body {
  font-family: 'Open Sans', sans-serif;
}        
</style>
</head>
<body>
VeryPDF test customized font for HTML to PDF Conversion.
</body>
</html>

I'm using 'Open Sans' font in this example, of course, you can use any font that you want.

You can also use following method to embed a font into HTML file itself,
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
@font-face {
font-family: VeryPDF_Arial;
src: url('http://online.verypdf.com/app/fonts/arial.ttf') format('truetype');
}
body {
  font-family: 'VeryPDF_Arial', sans-serif;
}

</style>
</head>
<body>
VeryPDF test customized font for HTML to PDF Conversion.
</body>
</html>

btw, VeryPDF Cloud API is now support five methods to convert a HTML file to PDF file, the APP Names are: html2pdf, html2pdf2, html2pdf3, html2pdf4, html2pdf5. These methods are using different technologies to render a HTML page to PDF file, you can test them and choose a best one for using.

http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXXXX&app=html2pdf
&infile=https://dl.dropboxusercontent.com/u/5570462/temp.html

http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXXXX&app=html2pdf2
&infile=https://dl.dropboxusercontent.com/u/5570462/temp.html

http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXXXX&app=html2pdf3
&infile=https://dl.dropboxusercontent.com/u/5570462/temp.html

http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXXXX&app=html2pdf4
&infile=https://dl.dropboxusercontent.com/u/5570462/temp.html

http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXXXX&app=html2pdf5
&infile=https://dl.dropboxusercontent.com/u/5570462/temp.html

If you encounter any problem during using HTML to PDF Cloud API, please feel free to let us know.

VeryPDF

VN:F [1.9.20_1166]
Rating: 7.0/10 (4 votes cast)
VN:F [1.9.20_1166]
Rating: -1 (from 1 vote)
How to specify font using HTML to PDF Converter Cloud API?, 7.0 out of 10 based on 4 ratings

Related Posts

This entry was posted in VeryPDF Cloud API and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!