Jump to content

Search the Community

Showing results for tags 'pdf'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 24 results

  1. Hello, I have a sample shop that generates a receipt on products purchased. When a user checks out it generates a receipt as a pdf file using dompdf. If i select a few products and generate a pdf file its ok it shows the products and total price, however if i choose lots of products, too many to fit on one page then when i generate a pdf it only show the first page the rest of the products and the total price are not displayed on page 2 ? Here is the bit of the code that generates the pdf sorry i am not very experienced in this stuff i am trying to learn ! $options = new Dompdf\Options(); $options->set('isRemoteEnabled', true); $dompdf = new Dompdf\Dompdf($options); $dompdf->loadHtml($html); $dompdf->render(); $output = $dompdf->output(); $info = file_put_contents("../../files/" . $filepath . $filename, $output); return array($filename,$filepath); any advice please.
  2. I have a php application that serves pdf downloads. It works fine on all devices and browsers with one small but really annoying side-effect (edge-case for sure) When I look at my download logs anytime the download is triggered from Chrome on Android it is called twice! Bizarre behavior and I can't figure it out. Some background: The download is a pdf that get's created on the fly. All requests get processed through my index.php controller. I was serving the request with javascript via: window.open('export?file=something_to_inform_the_controller'); Works great in all browsers and devices but android chrome triggers this twice. So I got wise and though maybe a direct link would work better: <a target="_blank" href="http://mysite.com/export?file=abc123" download="file.pdf">DL link</a> or <a target="_blank" href="http://mysite.com/export?file=abc123">DL link</a> or <a target="_self" href="http://mysite.com/export?file=abc123" download="file.pdf">DL link</a> or <a target="_self" href="http://mysite.com/export?file=abc123">DL link</a> Nope, none of these flavors prevents android/chrome from double downloading. Then I researched my php header settings and tried: content-disposition: inline vs. content-disposition: attachment with no success Note, the download is logged when the controller processes the request for the download. I have duplicated download events for all downloads on android/chrome. It's strange that I have not found a solution online for this or maybe I'm overlooking something silly. Any ideas?
  3. Alright I am so close but can not figure this out, thanks in advance for any help. So what I am trying to do is take the input variables from a form and have them load a specific PDF . <html> <body> <?php if( $_GET["startpoint"] || $_GET["endpoint"]) { $a = $_GET["startpoint"]; $b = $_GET["endpoint"]; echo "Your Startpoint is:". $_GET["startpoint"]. "<br />"; echo "Your Endpoint is: ". $_GET["endpoint"]. "<br />"; echo $a,$b,".pdf"; } ?> </body> </html> This is what I have and it works to display what the two points are what the final pdf file should be. The final echo generates the PDF name echo $a,$b,".pdf"; How can I get it to load a file using this as a variable or the name it generates, thanks.
  4. I understand that is might be something that is already answered and I apologize if it is, I could not find it. What I need to do is build a simple form that has two options, they will be dropdown options. Dropdown A and Dropdown B then a Submit button. This part I understand in HTML, although it may be easier in php or javascript. Then I need it to take the two options and create a "if/then" statement that loads a specific pdf that matches the two options selected. Example. If someone selects Option 1 from Dropdown A and Option 2 From Dropdown B then it loads 12.pdf If someone selects Option 5 from Dropdown A and Option 3 From Dropdown B then it loads 53.pdf If someone selects Option 2 from Dropdown A and Option 1 From Dropdown B then it loads 21.pdf and so on... It does not have to be the exact thing just some way to take both inputs and have it equal a specific pdf. Here is the form I built but I don't know what to put in the form_action.php file in order to make it work <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <center> <h1> Get Directions</h1> <form action="form_action.php" method="get" name="directions" target="_new"> <select name="startpoint" size="1"> <option value="north">North Tower Entrance</option> <option value="south">South Tower Entrance</option> <option value="moba">MOB A Entrance</option></select> -----> <select name="endpoint" size="1"> <option value="onco">Oncology</option> <option value="radio">Radiology</option> <option value="pulm">Pulmanary</option></select> <br /><br /> <input type="submit" value="Submit" /> </form> </center> </body> </html> Any help is appreciated, thanks.
  5. Hi all! I'm new here, apologies that my 1st post will be a cry for help. I'm tearing my hair out with this one. I've got this page that generates PDF's via TCPDF plugin http://www.kinho.com/lightbox/ whenever I view it in chrome it zooms in at 100% to the top left corner. The problem is I need the images to be large and suitable to print (7"x5" or thereabouts) and so the PDF isn't built to be viewed at 100%, it just looks too zoomed in. Every other browser respects the fit to width setting. My images are 1600px on their long side, pages are landscape. here's the create.php:https://dl.dropboxusercontent.com/u/14123055/PHP/create.php Can anybody advise a workaround for chrome? many thanks! badger
  6. I have searched for the solution for so long and I still could not solve my problem. I have a localhost server where it stored some pdf files for download. I implemented the following function to force the download: if(isset($_POST['dlPDF'])) { $file = $_SERVER['DOCUMENT_ROOT'] .'/Upload/'.$pdfName; header("Content-Type: application/pdf"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=$pdfName"); header("Content-Transfer-Encoding: binary"); // read the file from disk readfile($file); } However I could not open the pdf file properly since it says "the pdf file is not correctly encoded". FYI, the downloaded pdf file is always a few Kb larger than the original file. Please kindly let me know if there is anything I can do to make the pdf readable and I appreciate your help.
  7. I need to get the page count of a multi-tiff and pdf file using php. I've looked into imagick but i'm having a hard time getting it to work. i'm using windows 2k3 iis, and php 5.2.8. Any suggestions? Thanks.
  8. How to create a pdf dynamically and that pdf should sent as a email attachment.
  9. <?PHP require("../fpdf/fpdf.php"); include("db.classes.php"); $g = new DB(); $g->connection(); class PDF extends FPDF { .....codes..... } $pdf = new PDF(); .....codes..... $pdf->SetFont('Arial','',14); $pdf->AddPage('L', 'Legal'); $pdf->SetXY(20,20); $pdf->image('../images/DCWD Watermark.png'); $pdf->SetY(35); // call the table creation method $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,$plateNo); $pdf->SetY(45); $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,$model); $pdf->SetXY(310, 45); $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,date("m/d/Y")); $pdf->SetY(55); $pdf->BuildTable($header,$data); $pdf->Output(); ?> Why is FPDF's Output not working? or is something wrong with my browser? I already tried putting paramaters on it but still no go I tried Output('foo.pdf','I') not working but if i itegrate my chrome withIDM it just downloads but when i disable integrationnothing happens.
  10. Hi - we're trying to attach a .pdf to an email and mail it to a client - not working -- here's the code - l'll highlight what I think I understand... =) I've inherited this php project and I'm in no way a PHP person though I can usually do minor fixes -- this is beyond me however. The owner of the site said that up until a year ago, this code was working. ps - I've tried incorporating swiftmailer and phpmailer but don't know how to configure those using this password verifying code and an "include" that's not a .pdf question - is this code fixable and if so, how? <?php orange = goes to database, verifies passwords, that the report was paid for, etc - oks access and sets the "to" email address as $i_email $i_get_sid = isset($_GET["sid"]) ? (int)$_GET["sid"] : $i_sid; $i_get_pass = isset($_GET["a"]) ? $_GET["a"] : $_SESSION['r_pass']; $i_get_pass = addslashes($i_get_pass); $i_qry1 = db_qry("SELECT * FROM reports WHERE sid={$i_get_sid} AND ispurchased=1 AND isenabled=1 AND passhash='$i_get_pass'") or die("Error: report-4, SQL request error #1 ".mysql_error()); if($i_qry1) { if($i_rec1=mysql_fetch_array($i_qry1)) { $i_fname = $i_rec1["fname"]; $i_lname = $i_rec1["lname"]; $i_email = $i_rec1["email"]; } db_free_result($i_qry1); } blue - imports the file where the pdf is generated using FPDF, gives it the variable $data and attaches(or embeds? - not sure) to the email if(!empty($i_email)) { ob_start(); include('inc/pages/report-3.inc.php'); $data = ob_get_contents(); ob_end_clean(); $data = wordwrap(base64_encode($data), 72, "\n", true); $i_boundary = '----------'.bin2hex(mhash(MHASH_MD5, time())); $i_headers = "From: oursite.com <info@oursite.com> green - sets the content of the email message X-Mailer: oursite.com PHP Mail (v1.0) Reply-To: oursite.com <info@oursite.com> X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=\"$i_boundary\""; $i_message = "--$i_boundary Content-Type: text/plain; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit Dear ".$i_fname." ".$i_lname.", Here is the report you asked for, attached as an Adobe Acrobat document. If you do not already have one, an Adobe Acrobat reader can be downloaded for free at http://www.adobe.com/. ---- Best regards, Sports Team mailto:info@oursite.com --$i_boundary Content-Type: APPLICATION/PDF; name=\"report.pdf\" Content-transfer-encoding: base64 Content-Disposition: attachment; filename=\"report.pdf\" $data {$i_boundary}-- "; shows a new message in the browser to the user saying the emails been sent @mail($i_email, ' Sports - Your Report', $i_message, $i_headers); @mail('null@sight2k.com', 'Sports - Your Report', "ID - $i_get_sid", $i_headers); } header('Content-type: text/html'); $m_header = '<link href="shared/report.css" rel=stylesheet type="text/css">'; require_once($DOCUMENT_ROOT."inc/top-2.inc.php"); $i_get_sid = isset($_GET["sid"]) ? (int)$_GET["sid"] : $i_sid; $i_get_pass = isset($_GET["a"]) ? $_GET["a"] : $_SESSION['r_pass']; $i_get_pass = addslashes($i_get_pass); echo '<table cellpadding=0 cellspacing=0 border=0 width="100%">'; echo '<tr vAlign=top><td height=7><img src="images/1x1.gif" width=1 height=7></td></tr>'; echo '<tr height=28 style="background: url(images/bookm-bg.gif) repeat-x"><td width="100%"><nobr>'; echo '<img src="images/1x1.gif" width=5 height=1><a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'"><img src="images/bookm-42.gif" width=67 height=28 border=0></a><a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=pdf"><img src="images/bookm-s3.gif" width=10 height=28 border=0><img src="images/bookm-52.gif" width=65 height=28 border=0></a> <a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=/report.pdf"><img src="images/button-downloadpdf.gif" width=80 height=28 border=0></a> <a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=email"><img src="images/button-emailpdf.gif" width=80 height=28 border=0></a>'; echo '</nobr></td><td><nobr><font style="font-size: 10px;"><a href="javascript:window.close();">Close Window</a> </font></nobr></td></tr></table>'; echo "<p> Thank you."; echo "<p> Your report has been successfully sent."; require_once($DOCUMENT_ROOT."inc/btm-2.inc.php"); // header("location: report.php?sid=$i_get_sid&a=".urlencode($i_get_pass)); ?> >>>>>The output is this instead of an email with attachment: ------------fd755da9fdf74bb9c832b8a95272fd4b Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Dear "client", Here is the report you asked for, attached as an Adobe Acrobat document. If you do not already have one, an Adobe Acrobat reader can be downloaded for free at http://www.adobe.com/. ---- Best regards, Sports Team mailto:info@oursite.com ------------fd755da9fdf74bb9c832b8a95272fd4b Content-Type: APPLICATION/PDF; name="report.pdf" Content-transfer-encoding: base64 Content-Disposition: attachment; filename="report.pdf" JVBERi0xLjMKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL1Jlc291cmNl cyAyIDAgUgovQ29udGVudHMgNCAwIFI+PgplbmRvYmoKNCAwIG9iago8PC9GaWx0ZXIgL0Zs YXRlRGVjb2RlIC9MZW5ndGggMzE1Pj4Kc3RyZWFtCnicdVLLTsMwELznK+YIUnHtXTuxb0BL JbghIu6hpKgoaUqSgvr3rBNCAQlbstfemdnxg3CXaOUyfCTXOeYrA2OU1sg3uMmTN1jn4jL2 .....(goes on forever)
  11. Hi All, I have a question for you all. My client would like a component developed for Joomla that will allow them to upload PDF magazines to the website and then it be output on the PDF in a secure format so they cannot be downloaded or copied. Does anyone know of an open source solution that might enable me to do this. The requirement is that this not be made using flash so that it will work on iOS devices. There are two ways I can see this working, either when the PDF is uploaded it gets converted into a different format so it can simply be integrated into the page when output, or the PDF gets uploaded as it, and it output in some wrapper that will protect it, im really not quite sure, you any advice will be great! Thanks for your help! I look forward to hearing your responses.
  12. as far i compare, mpdf is quite amazing, simple and easy. others conversion library is tcpdf, fpdf, dompdf, wkhtml2pdf.. so far, only fpdf and mpdf can convert the php to pdf. i try to convert a php form to pdf. for example when we want to book a flight ticket. after the booking process, we will get the booking details in pdf form. any idea how to implement the pdf in php form?
  13. hello guys, i have this kind of issue where data that i call from database does not appear in the form. there is no syntax error, but it does not appear on the form i create. as follow:- http://prntscr.com/303h3q http://prntscr.com/303hb3 where should it be place?
  14. i'm wondering what is this problems. i copy paste it to other page. it works fine. but only this page have the error. spend most of time searching solution and i google for other solution still not working. the dreamweaver said there is no syntax error but when running it on localhost. then this appear "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\fpdf\form3_final_dead.php on line 14" 2nd, i'm creating a form.. it should be look like this : http://prntscr.com/2xfd0g but when run on localhost, this happen : http://prntscr.com/2xfd48 //note that, there is a missing column in the page. the code also contain this
  15. Hello and thanks in advance for any advice until recently, when our pdf was displayed in the browser, the whole pdf showed up - now (within the past 2-3 months) only about 1/3 of it shows Here's the page http://www.manofsteelesports.com/nonjphp/report.php?sid=128&a=d728d31d84495231a61b35d1ad7ccdcd&b=pdf I've looked at this in both Chrome and IE the php statement we're using in the PHP file that converts the HTML to pdf is $pdf->Output(); //Outputs on browser screen Any ideas on why this is happening and how to fix it?
  16. I want to display Student's Result as a PDF file.I have used fpdf library from http://www.fpdf.org/ I have followed their scripts for HTML table (Author Azeem Abbas) Here is my result link: http://bhc.edu.in/commerce/Studresult.php?exno=12345 I want to align the tables' rows and columns.How can i?Please help. My PDF file : (Studresult.php) http://pastebin.com/LdTwc3ya HTML Table by fpdf: (html_table.php) http://pastebin.com/hc6xjPua Thanks in advance
  17. I have a website where I allow people to submit a .pdf file and it is then displayed in an iframe or in a pdf object in a div. The names of the files always stay the same, and are uploaded to a specific folder. Problem is- when they upload a new .pdf file....the browser always displays the old .pdf file. Deleting temp files- doesn't change. <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> does not work Is there a way to make sure that the current and updated pdf file gets served to the browser and it displays it? Any suggestions would help. Andy
  18. Hi all Basically, I'm looking for a way in PHP to read plain ascii text from out of any .pdf file I've Googled around a bit, but so far everything I've found suffers from either one of two drawbacks : 1. It requires me to install something on the server, which I'd rather not do, I'm looking for some PHP classes ideally 2. The recommended code, despite its promises, just doesn't work in practice! So basically, I'm asking does anybody know of anything to read text from a PDF file which they have used for themselves and can recommend. Many thanks.
  19. Hi I have a problem to send php page with data to printer directly. Below code is working fine but only print issue. Pls help me Html page <style type="text/css"></style> <?php include '../templete/header.php'; ?> <Script Language="javascript"> function change_action() { var frm_obj=document.getElementById("frm"); frm_obj.action="data.php"; } </Script> <table class="tbl_table" align="center"> <form action="" method="POST" id="frm" > <tr> <td class="td_title" colspan="2"><strong>Outstanding Balance Report</strong></td> </tr> <tr> <td class="td_class_right">Until:</td> <td><input class="textdesign" type="text" id="datepicker1" name="datefrom" /></td> </tr> <tr> <td class="td_button" colspan="2"> <input class="buttondesign" type="submit" value="Search" name="search" onclick="change_action()"> <input class="buttondesign" type="submit" value="print" name="print" onclick="change_action()"> </td> </tr> </form> </table> data.php <?php include_once '../inc/connection.inc.php'; ?> <?php if (isset($_POST['search']) && $_POST['search'] != "" ) { $datefrom=$_POST["datefrom"]; $s = $dbh->prepare("EXECUTE usp_OutStanding_Balance ?"); $s->bindParam(1, $datefrom, PDO::PARAM_STR); $stmt = $s->execute(); $stmt = $dbh->query("SELECT * FROM vw_OutStanding_Balance ORDER BY MVName"); $stmt->setFetchMode(PDO::FETCH_ASSOC); include 'view.html.php'; } ?> <?php if (isset($_POST['print']) && $_POST['print'] != "" ) { $datefrom=$_POST["datefrom"]; $s = $dbh->prepare("EXECUTE usp_OutStanding_Balance ?"); $s->bindParam(1, $datefrom, PDO::PARAM_STR); $stmt = $s->execute(); $stmt = $dbh->query("SELECT * FROM vw_OutStanding_Balance ORDER BY MVName"); $stmt->setFetchMode(PDO::FETCH_ASSOC); include 'print.html.php'; } ?> print.html.php <?php include '../templete/print_head.php'; ?> <?php $groupby = ''; $displaySubTotal = FALSE; $subTotal = 0; $grandTotal = 0; $sub_debit=0; // maideen $grn_debit=0; // maideen $sub_credit=0; // maideen $grn_credit=0; // maideen $sub_bal=0; // maideen $grn_bal=0; // maideen ?> <div class="title">Outstanding Report</div> <table width="100%" align="center" cellpadding="4" cellspacing="1" class=tbl_table"> <tr><td colspan="6"><hr /></td></tr> <tr> <td class="tdempty"></td> <td class="tbl_header">MV CODE</td> <td class="tbl_header">MV NAME</td> <td class="tbl_header_right">DEBIT</td> <td class="tbl_header_right">CREDIT</td> <td class="tbl_header_right">BALANCE</td> <td class="tdempty"></td> </tr> <tr><td colspan="6"><hr /></td></tr> <?php if(isset($stmt)) { while($row = $stmt->fetch()): if($groupby!=$row['MVName']): if($displaySubTotal): ?> <?php $grn_debit += $sub_debit; $sub_debit=0; $grn_credit += $sub_credit; $sub_credit=0; $grn_bal += $sub_bal; $sub_bal=0; else: $displaySubTotal = TRUE; endif; $groupby = $row['MVName']; endif; ?> <tr> <td class="tdempty"></td> <td class="tbl_content"><?php echo $row['MVcode'];?></td> <td class="tbl_content"><?php echo $row['MVName'];?></td> <td class="tbl_content_right"><?php echo number_format($row['Debit'],2) ;?></td> <td class="tbl_content_right"><?php echo number_format($row['Credit'],2) ;?></td> <td class="tbl_content_right"><?php echo number_format($row['Balance'],2) ;?></td> <td class="tdempty"></td> </td> <?php $sub_debit += $row['Debit']; $sub_credit += $row['Credit']; $sub_bal += $row['Balance']; endwhile; $grn_debit += $sub_debit; $grn_credit += $sub_credit; $grn_bal += $sub_bal; ?> <tr><td colspan="6"><hr /></td></tr> <tr> <td colspan="2"> <td class="tbl_subtotal_left"><b>Grand Total</b></td> <td class="tbl_subtotal_right"><b><?php echo number_format($grn_debit,2); ?></b></td> <td class="tbl_subtotal_right"><b><?php echo number_format($grn_credit,2); ?></b></td> <td class="tbl_subtotal_right"><b><?php echo number_format($grn_bal,2); ?></b></td> </tr> <tr><td colspan="6"><hr /></td></tr> <?php }?> </table> <?php unset($dbh); unset($stmt); ?> Pls help me if anybody knows. I need once click the print button, system should send data to printer Regards Maideen
  20. Hi all, I need a code that downloads all PDF files of a URL (e.g. www.myurl.com)? I want to run this code on my localhost (WAMP). Thank You for you time.
  21. Hi, Can we read/manipulate PDF in PHP? Would appreciate your help. Thanks, Jyotsna
  22. how to print a pdf label from the data which i have stored in a mysql database? to pull all the data from database where user_id is = $_POST
  23. When I try to display PDF , not working when pdf contains path, just working if the file is in the same index This Works <a href="myfile.pdf" target="_blank">View PDF</a> The below not working .. ERROR The requested URL was not found on this server. <a href="admin/assets/cvs/myfile.pdf" target="_blank">View PDF</a> I am sure that the path is right and I tested with .png extensions. Also I tried to use header function to display PDF with PHP but got also error even if the file in the same directory index Failed to load PDF document. $fileName = "myfile.pdf"; header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="' .urlencode($fileName). '"'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($fileName)); header('Accept-Ranges: bytes'); @readfile($fileName);
  24. Every month I have pdf file with 40 pages, and I upload file to folder on webserver. Every user on internal company website have his own page in that pdf file. How to display specific page to specific user, without manual embedding to user profile page? Or display it on designated page for that pdf file, but with selection for user to pick his own page from pdf? Better option would be that user can navigate whole archive of pdf and pick year, month and his page from pdf. User's page in pdf has always same page number and his own phone number becouse pdf is phone bill for company mobile phones.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.