function image($img, $x, $y, $w, $h, $resolution = "normal") { list($width, $height, $type) = dompdf_getimagesize($img); $debug_png = $this->_dompdf->get_option("debug_png"); if ($debug_png) { print "[image:{$img}|{$width}|{$height}|{$type}]"; } switch ($type) { case IMAGETYPE_JPEG: if ($debug_png) { print '!!!jpg!!!'; } $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h); break; case IMAGETYPE_GIF: case IMAGETYPE_BMP: if ($debug_png) { print '!!!bmp or gif!!!'; } // @todo use cache for BMP and GIF $img = $this->_convert_gif_bmp_to_png($img, $type); case IMAGETYPE_PNG: if ($debug_png) { print '!!!png!!!'; } $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h); break; default: if ($debug_png) { print '!!!unknown!!!'; } } }
function image($img_url, $img_type, $x, $y, $w, $h) { switch ($img_type) { case "jpeg": case "jpg": $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h); break; case "png": $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h); break; default: break; } return; }
function image($img, $x, $y, $w, $h, $resolution = "normal") { list($width, $height, $type) = $this->getimagesize($img); switch ($type) { case IMAGETYPE_JPEG: $this->canvas->addJpegFromFile($img, $x, $y - $h, $w, $h); break; case IMAGETYPE_GIF: case IMAGETYPE_BMP: // @todo use cache for BMP and GIF $img = $this->_convert_gif_bmp_to_png($img, $type); case IMAGETYPE_PNG: $this->canvas->addPngFromFile($img, $x, $y - $h, $w, $h); break; default: } }
function image($img_url, $img_type, $x, $y, $w, $h) { $img_type = mb_strtolower($img_type); switch ($img_type) { case "jpeg": case "jpg": $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h); break; case "png": $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h); break; case "gif": // Convert gifs to pngs $img_url = $this->_convert_gif_to_png($img_url); $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h); break; default: break; } return; }
function image($img, $x, $y, $w, $h, $resolution = "normal") { list($width, $height, $type) = Helpers::dompdf_getimagesize($img, $this->get_dompdf()->getHttpContext()); $debug_png = $this->_dompdf->getOptions()->getDebugPng(); if ($debug_png) { print "[image:{$img}|{$width}|{$height}|{$type}]"; } switch ($type) { case "jpeg": if ($debug_png) { print '!!!jpg!!!'; } $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h); break; case "gif": case "bmp": if ($debug_png) { print '!!!bmp or gif!!!'; } // @todo use cache for BMP and GIF $img = $this->_convert_gif_bmp_to_png($img, $type); case "png": if ($debug_png) { print '!!!png!!!'; } $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h); break; case "svg": if ($debug_png) { print '!!!SVG!!!'; } $this->_pdf->addSvgFromFile($img, $x, $this->y($y) - $h, $w, $h); break; default: if ($debug_png) { print '!!!unknown!!!'; } } }
function image($img_url, $img_type, $x, $y, $w, $h) { //debugpng if (DEBUGPNG) { print '[image:' . $img_url . '|' . $img_type . ']'; } $img_type = mb_strtolower($img_type); switch ($img_type) { case "jpeg": case "jpg": //debugpng if (DEBUGPNG) { print '!!!jpg!!!'; } $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h); break; case "png": //debugpng if (DEBUGPNG) { print '!!!png!!!'; } $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h); break; case "gif": // Convert gifs to pngs //DEBUG_IMG_TEMP //if (0) { if (method_exists($this->_pdf, "addImagePng")) { //debugpng if (DEBUGPNG) { print '!!!gif addImagePng!!!'; } //If optimization to direct png creation from gd object is available, //don't create temp file, but place gd object directly into the pdf if (method_exists($this->_pdf, "image_iscached") && $this->_pdf->image_iscached($img_url)) { //If same image has occured already before, no need to load because //duplicate will anyway be eliminated. $img = null; } else { $img = @imagecreatefromgif($img_url); if (!$img) { return; } imageinterlace($img, 0); } $this->_pdf->addImagePng($img_url, $x, $this->y($y) - $h, $w, $h, $img); } else { //debugpng if (DEBUGPNG) { print '!!!gif addPngFromFile!!!'; } $img_url = $this->_convert_gif_to_png($img_url); $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h); } break; default: //debugpng if (DEBUGPNG) { print '!!!unknown!!!'; } break; } return; }
/*rule off for total */ $pdf->line($Page_Width - $Right_Margin - 222, $YPos - 2 * $line_height, $Page_Width - $Right_Margin, $YPos - 2 * $line_height); /*vertical to separate totals from comments and ROMALPA */ $pdf->line($Page_Width - $Right_Margin - 222, $YPos + $line_height, $Page_Width - $Right_Margin - 222, $Bottom_Margin); $YPos += 10; if ($InvOrCredit == 'Invoice') { $LeftOvers = $pdf->addTextWrap($Page_Width - $Right_Margin - 220, $Bottom_Margin + 5, 144, $FontSize, _('TOTAL INVOICE')); $FontSize = 8; $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos - 18, 280, $FontSize, $_SESSION['RomalpaClause']); while (mb_strlen($LeftOvers) > 0 and $YPos > $Bottom_Margin) { $YPos -= 10; $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos - 18, 280, $FontSize, $LeftOvers); } /* Add Images for Visa / Mastercard / Paypal */ if (file_exists('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg')) { $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg', $Page_Width / 2 - 60, $YPos - 15, 0, 20); } // Print Bank acount details if available and default for invoices is selected $pdf->addText($Left_Margin, $YPos + 22 - $line_height * 3, $FontSize, $DefaultBankAccountCode . ' ' . $DefaultBankAccountNumber); $FontSize = 10; } else { $LeftOvers = $pdf->addTextWrap($Page_Width - $Right_Margin - 220, $Bottom_Margin + 5, 144, $FontSize, _('TOTAL CREDIT')); } $LeftOvers = $pdf->addTextWrap($Page_Width - $Left_Margin - 72, $Bottom_Margin + 5, 72, $FontSize, $DisplayTotal, 'right'); } /* end of check to see that there was an invoice record to print */ $FromTransNo++; } /* end loop to print invoices */ /* Put the transaction number back as would have been incremented by one after last pass */ $FromTransNo--;
#$pdf->setPreferences( "FitWindow", true); #$pdf->setPreferences( "CenterWindow",true); #$pdf->setPreferences( "NonFullScreenPageMode",True); // UseNone, UseOutlines, UseThumbs $unten = 50; $links = 20; $oben = 820; $pdf->addText($links, $oben, 11, 'links oben'); $pdf->addText($links, $unten, 11, 'links unten'); $pdf->addText(500, $oben, 11, 'rechts oben'); $pdf->addText(500, $unten, 11, 'rechts unten'); $row = $oben; for ($i = 1; $i <= 10; $i++) { $row = $row - 10; $pdf->addText($links, $row, 11, $i . ' drunter'); } $pdf->addJpegFromFile($pathvars["fileroot"] . "/images/net/vdmvd/otto.jpg", 70.86, 420.94, 100); $pdf->rectangle($links, $unten, 540, 780); /* $pdf->newPage(); $pdf->addText(0,830,'10pt','links oben'); $pdf->addText(540,830,10,'rechts oben'); $pdf->addText(0,5,10,'links unten'); $pdf->addText(540,5,10,'rechts unten'); */ $pdf->stream(); } else { include_once $pathvars["libraries"] . "xtra.pdf.php"; include_once $pathvars["libraries"] . "xtra.ezpdf.php"; $pdf = new Cezpdf(); $pdf->selectFont('./fonts/Helvetica.afm'); $pdf->openHere("Fit");
function image($img, $x, $y, $w, $h, $resolution = "normal") { list($width, $height, $type) = dompdf_getimagesize($img); //debugpng if (DEBUGPNG) print "[image:$img|$width|$height|$type]"; switch ($type) { case IMAGETYPE_JPEG: if (DEBUGPNG) print '!!!jpg!!!'; $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h); break; case IMAGETYPE_GIF: case IMAGETYPE_BMP: if (DEBUGPNG) print '!!!bmp or gif!!!'; // @todo use cache for BMP and GIF $img = $this->_convert_gif_bmp_to_png($img, $type); case IMAGETYPE_PNG: if (DEBUGPNG) print '!!!png!!!'; $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h); break; default: if (DEBUGPNG) print '!!!unknown!!!'; } }