I am using the html2canvas library to render the page with a view to rendering the canvas as a PDF. I am saving the canvas as an Attachment fine. The direct link to the attachment looks like this:
without any margin or padding. But when I render it as a PDF there is always a blank first page like so:
I tried adding the margin attribute to the @page but it had no effect. Is there any way to prevent this blank page from appearing? Here's the VF code, the controller just sets the Attachment ID.
<apex:page controller="toPdf" renderAs="pdf" applyBodyTag="false" applyHtmlTag="false" showHeader="false" cache="false">
<html>
<head>
<style>
@page{
size: A4 landscape;
margin: 0in;
}
</style>
</head>
<body>
<apex:image value="/servlet/servlet.FileDownload?file={!attId}" width="1024px"/>
</body>
</html>
</apex:page>