Answer the question
In order to leave comments, you need to log in
After the transfer from my client to the host, the picture in pdf is no longer displayed, what could be the problem?
On my website, a pdf file is attached in letters, and there is a picture-signature in it.
I did it with dompdf, and on my hosting everything worked and works safely.
No plug-ins, plug-ins did not fit what I needed - a long explanation - SIMPLY NO, I made the document myself, connected it without a composer. everything worked.
add_filter( 'woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 3);
function attach_terms_conditions_pdf_to_email ( $attachments , $id, $object ) {
$your_pdf_path = get_template_directory() . '/pdf-test.pdf';
$attachments[] = $your_pdf_path;
return $attachments;
}
require_once get_template_directory() . '/assets/dompdf/autoload.inc.php';
use Dompdf\Dompdf;
$dompdf = new Dompdf();
ob_start();
require(get_template_directory().'/pdf-test.php');
$content_pdf = ob_get_clean();
$dompdf->loadHtml( $content_pdf);
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A3', 'portarait');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$output = $dompdf->output();
file_put_contents(get_template_directory() . '/pdf-test.pdf', $output);
?>
$dompdf->set_option('isRemoteEnabled', TRUE);
<img style="width: 65%;float:right;" src="<?php echo get_template_directory_uri(); ?>/signature.png" />
Answer the question
In order to leave comments, you need to log in
get_template_directory_uri() returns relative url? does the client have a directory with the signature.png file that this link corresponds to?
Obviously, it's worth checking what the new hosting givesget_template_directory_uri()
. For example, whether it points to the old hosting at all.
Encode the image in base64 and put it in src - then you won't have to mess with any files.
Understood and everything was very golobalno. There were no required modules on the host. I had to connect to VPS. Very, very frozen. Now it seems to be working
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question