Reputation: 2991
Is there a way to set a PDF as a background for an HTML file? It needs to be compliant to CSS v2.1. I'm looking to doing something like this in the html page:
body {
background-image: url(FULLURL/myPDF.pdf);
}
The main purpose behind this is to to basically render an HTML as a PDF, overlaying an already existing PDF. (This I'm doing with PHP and resources like DOMPDF)
The reason it was to be CSS v2.1 compliant, is because the resource is set that way: https://github.com/dompdf/dompdf
Anyone have any ideas? I'm a bit stuck.
Upvotes: 6
Views: 22542
Reputation: 1
Referring to the original question: it is possible and it's actually pretty annoying! It leaves a whole white block on the webpage before the actual content; it can be viewed by right clicking View Background Image...
It looks like (incorrect URL):
Upvotes: 0
Reputation: 28209
Background not an option as far as I know. But refer embed pdf to view a pdf on a page.
Upvotes: 3
Reputation: 6252
Setting it as a background, no, not possible. You may be able to get away with an ugly hack, but... I think you need to rethink what you're trying to accomplish and find an alternative solution.
PDF is a proprietary format and therefore does not play well with open web languages.
Upvotes: 6