Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dompdf question

Status
Not open for further replies.

sd0t1

IS-IT--Management
Mar 14, 2007
131
US
I know this isn't a dompdf form, but since I was turned on to Dompdf here I thought I may get pointed in the right direction.

First let me say that I've posted this issue in the dompdf forum but they haven't responded and I notice that quite a few posts go with out answer over there.

So anyway, I'm successfully creating multiple status reports into an html page. My goal is to create one big document made up of multiple offender status reports.

Well the html document looks fine, but when I have dompdf pick up the document and convert it to pdf the first page comes out fine, but the other data all prints onto 1 line at the top of page two.

Any help would be greatly appreciated.
 
curious. can you give us some sample html output? or if it's confidential you could upload stuff to me directly through this upload link (always assuming that you can trust me with the data!)

 
Thanks for looking at this jpadie, the data isn't confidential yet, it's all test data.

I've uploaded a copy of the status report to you. It generates between 2 and 20 status reports, this particular one only has 2.

I sent you the .html and the .pdf. You'll notice the .pdf's second page is overlapping all the text for the whole page on the top line of the page.
Yet the .html is fine and printed correctly.

Here is the dompdf script that converts it.


<?php
require_once("../dompdf/dompdf_config.inc.php");
require_once('../Connections/user_login.php');
session_start();

$myFile = $_SESSION['loggedUser']."array_report.html";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);



$html = $theData;

$size = 'letter';

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper($size, "Portrait");


$dompdf->render();
//$dompdf->stream("my_pdf.pdf", array("Attachment" => 1));
file_put_contents("StatusReport.pdf", $dompdf->output());
unlink($myFile);


$email = $_GET['email'];
header("Location: send_2_stat.php?email=$email");

?>
 
Hi Jpadie, did you get a chance to check out the files I uploaded to you the other day. I hate to be a pest, but I still haven't got a reply from the dompdf forum and can't find anything on the net about my particular problem.

Any help (as usual) would be greatly appreciated.
 
i've got the files yes. ihave not had a chance to test them nor to debug dompdf (as i assume it's a bug in dompdf rather than your code).
 
I'm not sure I would assume that:) as this is my first time using dompdf. Although I will say that Dom seems straight forward and it works fine for me as long as I'm converting just one page to pdf.

Well please take your time, I'm not rushing you at all I just appreciate you doing this for me. I at least wanted to make sure you had the files.

Thanks.
 
yup, i've got the files. i should put more feedback into the upload mechanism. i only use it as the site policy prohibits email address posting (rightly so).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top