0

I am trying to create a pdf using a Visualforce page with renderas="pdf" tag but I get below error message

PDF generation failed. Check the page markup is valid.

Here is my code below:

<apex:page standardController="WorkOrder" extensions="InstallationCertPageController" 
    renderAs="pdf" applyBodyTag="false" applyHtmlTag="false" showHeader="false">
<html>
    <head>
        <style>
    ...myStyle...
        </style>
    </head>
    <body>
    ...some code...
        <div style="position: fixed; bottom: 11px; right: 0px;" >
            <img src="***image url***"/>
        </div>
    </body>
</html>

I get it that the real problem is the inline CSS position: fixed;.

It worked until Salesforce update winter 18.

Any ideas how I can fix it?

5
  • 1
    So, if you remove that style property, does it work as expected?
    – kurunve
    Sep 14, 2017 at 8:29
  • Yes, I've already tried
    – Daniele
    Sep 14, 2017 at 8:32
  • so, does it work?
    – kurunve
    Sep 14, 2017 at 8:59
  • comment few blocks -> run the page; run until you narrow down the exact error.
    – Raul
    Sep 14, 2017 at 9:44
  • Hi @Daniele, did you ever get this resolved? I'm now encountering the same issue with "position: running(header)". Nov 13, 2020 at 8:44

1 Answer 1

-1

Couple of things that i can say, first check whether all html tags in the VF page are closed properly and secondly, since you using inline CSS style then set the API version later than 28.

1
  • Thanks, the apiVersion is 39.0. I have checked all closed tags. Should I try other version?
    – Daniele
    Sep 14, 2017 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.