vfl_freak
Premium-User
Moin,
Gruß Klaus
WAS hast Du verstanden ?????Verstanden, vielen Dank
Gruß Klaus
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
WAS hast Du verstanden ?????Verstanden, vielen Dank
dass "du keine Lust, hier ewig rumzuraten"Moin,
WAS hast Du verstanden ?????
Gruß Klaus
also alle meine Bilder befinden sie sich in dem folgenden Pfad C:\xampp\htdocs\kan\imagesMoin,
das hatte ich befürchtet ... :-]
Und warum postet Du dann nicht den konkreten Pfad, so wie er im Dateisystem vorkommt ???
Isses denn so schwer ??
Gruß Klaus
$htmlString .= '<div style="position: relative;">
<img style=" z-index: 1; left: 40px; top: 10px; width: 190px; height: 170px;" src="images/' . $path . '" border="0"/></div></td>';
so fange ich mein Code an :...
Kannst du uns den Code zeigen, wie du Dompdf aufrufst?
Oder sogar den ganzen Code in der Datei?
Was steht in $path?
$selection = $dbConnect->prepare('SELECT * FROM drucker WHERE sessionID = :sessionID');
$selection->bindValue(':sessionID', $sessionID);
$selection->execute();
$prints = $selection->fetchAll(PDO::FETCH_ASSOC);
$products = array();
foreach ($prints as $print) {
if ($print['type'] === 'product') {
$productsData = $dbConnect->prepare('SELECT * FROM product WHERE id = :id');
$productsData->bindValue(':id', $print['prod_id']);
} else {
$productsData = $dbConnect->prepare('SELECT v.*, p.path FROM variants v LEFT JOIN product p ON p.id = v.img_id WHERE p.id = :id AND v.id = :v_id');
$productsData->bindValue(':id', $print['img_id']);
$productsData->bindValue(':v_id', $print['prod_id']);
}
$productsData->execute();
$products[] = $productsData->fetch(PDO::FETCH_ASSOC);
}
$length = count($products);
$htmlString = '';
$path = isset($products[$p]["path"]) ? $products[$p]["path"] : '';
$htmlString .= '<div style="position: relative;">
<img style=" z-index: 1; left: 40px; top: 10px; width: 190px; height: 170px;" src="images/' . $path . '" border="0"/></div></td>';
<?php
$sessionID = $_POST['sessionID'];
/** @var array $data */
$data = array();
require_once __DIR__ . '/html_to_pdf/dompdf/autoload.inc.php';
use Dompdf\Dompdf;
$file_path = __DIR__ . '/pdfs/pagepdf_'.$sessionID.'.html';
$file_path_pdf = __DIR__ . '/pdfs/pagepdf_'.$sessionID.'.pdf';
$pdf_download = str_replace('print.php', '', $_SERVER['REQUEST_URI']). 'pdfs/pagepdf_'.$sessionID.'.pdf';
if ($html = file_get_contents($file_path)) {
$dompdf = new Dompdf('P', 'A4', 'de', true, 'UTF-8');
$dompdf->loadHtml($html,'UTF-8');
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$output = $dompdf->output();
file_put_contents($file_path_pdf, $output);
$data['success'] = true;
$data['filePath'] = $pdf_download;
} else {
$data['success'] = false;
}
// return all our data to an AJAX call
echo json_encode($data);
src="./images/' . $path . '"
Hi sheel,Die Variable $p gibts nicht.PHP:$path = isset($products[$p]["path"]) ? $products[$p]["path"] : '';
$path ist deswegen leer.
...
Und getimagesize will eben kein Verzeichnis.
<img style=" z-index: 1; left: 40px; top: 10px; width: 190px; height: 170px;" src="images/Kant8.png" border="0"/></div></td>
<img style=" z-index: 1; left: 51px; top: 22px; width: 190px; height: 170px;" src="images/Kant1.png" border="0" /></div></td>
<img style=" z-index: 1; left: 40px; top: 10px; width: 190px; height: 170px;" src="images/Kant4.png" border="0"/></div></td>
<img style=" z-index: 1; left: 51px; top: 22px; width: 190px; height: 170px;" src="images/Kant4.png" border="0" /></div></td>
<img style=" z-index: 1; left: 40px; top: 10px; width: 190px; height: 170px;" src="images/Kant1.png" border="0"/></div></td>
<img style=" z-index: 1; left: 51px; top: 22px; width: 190px; height: 170px;" src="images/0wa.jpg" border="0" /></div></td>