Failed to Load PDF file error [RESOLVED]

Hi Team,

Here is the site url:

After submitting the form I get a pdf cant load error.

The same code works on the other site.

We are sending data to third party and getting a pdf in response.

if ( is_wp_error( $response_report ) ) {
  $error_message = $response_report->get_error_message();
  echo "Something went wrong: $error_message";
} else {
 	$data = $response_report['body'];
   header('Content-Type: application/pdf');
   echo $data; 


It worked for me. Slow, but it worked. Have you tried it in an incognito browser window so you’re not logged in or anything?

Thank you so much for your help. It worked on different machines that I tried on.


1 Like