Topic: pdf large files printing problems

I can print the majority of invoices, reports etc, but some do not giving a comment on the top line that PDF may not print properly. I am assuming it is when the file is above a certain size? Excel output always works ok.

I can, however, retrieve the pdfs from the company/1/pdf_file folder and these print perfectly. Can anyone advise me if there is a specific setting (in php.ini for instance) that I need to change/increase that will allow the PDF files to be accessed and printed in the normal manner

Thanks

Re: pdf large files printing problems

I doubt it has anything to do with size as such. If the file itself seems OK, then I'd suspect the problem to be related to how the server presents the file to the browser. It wouldn't open at all if the MIME type was wrong, but what if there was a mismatch between content-length and actual file size?

Do the offending files by any chance contain multi-byte UTF data? I can see how that could throw off a naive implementation expecting one character to equal one byte.

Re: pdf large files printing problems

I'm using v2.3.22 with English language C installed,  iso-8859-1 encoding on a Qnap TS219P+

I can generate PDF invoices at time of creation but I seem to have a problem creating PDFs from the Report and Analysis Screen. As noted I can retrieve them from the company/pdf_files/ folder perfectly.

I have the Dejavu files extracted in the reporting/fonts folder and the relevant line inserted in the class_pdf.inc file

It's beginning to annoy me having to retrieve the report 'longhanded' - How would the files get the multi-byte UTF data in them (As a result of a setting incorrect?) and how can I detect whether this is happening?

Many thanks for your help - much appreciated

Re: pdf large files printing problems

dls wrote:

How would the files get the multi-byte UTF data in them (As a result of a setting incorrect?)

I was thinking there might be some customer names/addresses, item descriptions etc. which contained them. That would explain why it doesn't happen every time.

dls wrote:

and how can I detect whether this is happening?

Reliably determining a file's encoding is trickier than one would imagine. Besides, there could well be other reasons the file size gets mangled. (There might not even be a file at that point, but rather a string stored in memory.)

So what I would do is to look at the server response to the requests for a) a dynamically generated report, and b) the same report served from company/pdf_files/

If the content-length headers of the two responses differ, there's your problem.

I would use something like Wireshark, but there's probably a plugin for your browser which can be used to debug HTTP headers.

Re: pdf large files printing problems

As noted above the PDF print generation problem is only directly from the reports and analysis screen. I can email the pdf from this screen ok and I can pick up a perfectly generated PDF from the company/1/pdf_files/ folder. The corrupt file output obtained directly from the screen is shown below. This should be a pdf file of the invoice/statement etc.

Any pointers as to which files to look at which generate the file from the reports and analysis screen?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html dir='ltr' >
<head profile="http://www.w3.org/2005/10/profile"><title>Reports and Analysis</title><meta http-equiv='Content-type' content='text/html; charset=iso-8859-1'><link href='../themes/default/default.css' rel='stylesheet' type='text/css'>
<link href='../themes/default/images/favicon.ico' rel='icon' type='image/x-icon'>
<script language="javascript" type="text/javascript" src="../company/1/js_cache/JsHttpRequest.js"></script><script language="javascript" type="text/javascript" src="../company/1/js_cache/behaviour.js"></script><script language="javascript" type="text/javascript" src="../company/1/js_cache/utils.js"></script><script language="javascript" type="text/javascript" src="../company/1/js_cache/inserts.js"></script><script language="javascript" type="text/javascript" src="../company/1/js_cache/reports.js"></script><script language="javascript" type="text/javascript" src="../company/1/js_cache/date_picker.js"></script></head>
<body><table class='callout_main' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='2' rowspan='2'>
<table class='main_page' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='quick_menu'>
<table cellpadding=0 cellspacing=0 width='100%'><tr><td><div class=tabs><a class='selected' href='../index.php?application=orders' accesskey='S'><u>S</u>ales</a><a class='menu_tab' href='../index.php?application=AP' accesskey='P'><u>P</u>urchases</a><a class='menu_tab' href='../index.php?application=stock' accesskey='I'><u>I</u>tems and Inventory</a><a class='menu_tab' href='../index.php?application=manuf' accesskey='M'><u>M</u>anufacturing</a><a class='menu_tab' href='../index.php?application=proj' accesskey='D'><u>D</u>imensions</a><a class='menu_tab' href='../index.php?application=GL' accesskey='B'><u>B</u>anking and General Ledger</a><a class='menu_tab' href='../index.php?application=system' accesskey='E'>S<u>e</u>tup</a></div></td></tr></table><table class=logoutBar><tr><td class=headingtext3>Leech & Sons | 91.84.138.17 | Administrator</td><td class='logoutBarRight'><img id='ajaxmark' src='../themes/default/images/ajax-loader.gif' align='center' style='visibility:hidden;'></td>  <td class='logoutBarRight'><a class='shortcut' href='../admin/display_prefs.php?'>Preferences</a>   
  <a class='shortcut' href='../admin/change_current_user_password.php?selected_id=admin'>Change password</a>   
<img src='../themes/default/images/login.gif' width='14' height='14' border='0' alt='Logout'>  <a class='shortcut' href='../access/logout.php?'>Logout</a>   </td></tr><tr><td colspan=3></td></tr></table></td></tr></table><center><table id='title'><tr><td width='100%' class='titletext'>Reports and Analysis</td><td align=right><span id='hints'></span></td></tr></table></center><div id='msgbox'></div><div id='_page_body'><table align='center' width='80%' style='border:1px solid #cccccc;'><tr valign='top'><td width='30%'><b>Report Classes:</b><br><a href='/frontaccounting/reporting/reports_main.php?Class=0' style='font-weight:bold' class='repclass_link' id='class0'>Customer</a> <br><a href='/frontaccounting/reporting/reports_main.php?Class=1' style='font-weight:normal' class='repclass_link' id='class1'>Supplier</a> <br><a href='/frontaccounting/reporting/reports_main.php?Class=2' style='font-weight:normal' class='repclass_link' id='class2'>Inventory</a> <br><a href='/frontaccounting/reporting/reports_main.php?Class=3' style='font-weight:normal' class='repclass_link' id='class3'>Manufacturing</a> <br><a href='/frontaccounting/reporting/reports_main.php?Class=4' style='font-weight:normal' class='repclass_link' id='class4'>Dimensions</a> <br><a href='/frontaccounting/reporting/reports_main.php?Class=5' style='font-weight:normal' class='repclass_link' id='class5'>Banking</a> <br><a href='/frontaccounting/reporting/reports_main.php?Class=6' style='font-weight:normal' class='repclass_link' id='class6'>General Ledger</a> <br></td><td width='35%' style='border-left:1px solid #cccccc;border-right:1px solid #cccccc;padding-left:3px;'><table class='repclass' id='TAB_0'  cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>Reports For Class:  Customer</b></td></tr>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=101' style='font-weight:normal' id='_el56b1c99f163177.24665220' accesskey='B'>Customer <u>B</u>alances</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=102' style='font-weight:normal' id='_el56b1c99f1648a0.88689630' accesskey='A'><u>A</u>ged Customer Analysis</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=103' style='font-weight:normal' id='_el56b1c99f165b76.09965020' accesskey='D'>Customer <u>D</u>etail Listing</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=114' style='font-weight:normal' id='_el56b1c99f166da2.30432197' accesskey='S'>Sales <u>S</u>ummary Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=104' style='font-weight:normal' id='_el56b1c99f167f96.40659362' accesskey='P'><u>P</u>rice Listing</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=105' style='font-weight:normal' id='_el56b1c99f169183.95003141' accesskey='O'><u>O</u>rder Status Listing</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=106' style='font-weight:normal' id='_el56b1c99f16a340.01355730' accesskey='S'><u>S</u>alesman Listing</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=107' style='font-weight:normal' id='_el56b1c99f16bd71.08439688' accesskey='I'>Print <u>I</u>nvoices</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=113' style='font-weight:normal' id='_el56b1c99f16cfd7.28356498' accesskey='C'>Print <u>C</u>redit Notes</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=110' style='font-weight:normal' id='_el56b1c99f16e1c5.36268778' accesskey='D'>Print <u>D</u>eliveries</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=108' style='font-weight:normal' id='_el56b1c99f16f3b5.57250059' accesskey='S'>Print <u>S</u>tatements</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=109' style='font-weight:normal' id='_el56b1c99f170581.11395967' accesskey='P'><u>P</u>rint Sales Orders</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=111' style='font-weight:normal' id='_el56b1c99f1717a1.27390745' accesskey='P'><u>P</u>rint Sales Quotations</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=0&REP_ID=112' style='font-weight:normal' id='_el56b1c99f172777.16529769'>Print Receipts</a><tr><td>
</table><table class='repclass' id='TAB_1' style='display:none' cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>Reports For Class:  Supplier</b></td></tr>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=1&REP_ID=201' style='font-weight:normal' id='_el56b1c99f174132.75308995' accesskey='B'>Supplier <u>B</u>alances</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=1&REP_ID=202' style='font-weight:normal' id='_el56b1c99f1753a2.99348034' accesskey='A'><u>A</u>ged Supplier Analyses</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=1&REP_ID=203' style='font-weight:normal' id='_el56b1c99f1765b4.98954137' accesskey='P'><u>P</u>ayment Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=1&REP_ID=204' style='font-weight:normal' id='_el56b1c99f177791.47039124' accesskey='G'>Outstanding <u>G</u>RNs Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=1&REP_ID=205' style='font-weight:normal' id='_el56b1c99f178970.71086221' accesskey='D'>Supplier <u>D</u>etail Listing</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=1&REP_ID=209' style='font-weight:normal' id='_el56b1c99f179b70.30048173' accesskey='O'>Print Purchase <u>O</u>rders</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=1&REP_ID=210' style='font-weight:normal' id='_el56b1c99f17ac22.91196124'>Print Remittances</a><tr><td>
</table><table class='repclass' id='TAB_2' style='display:none' cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>Reports For Class:  Inventory</b></td></tr>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=301' style='font-weight:normal' id='_el56b1c99f17c562.19128376' accesskey='V'>Inventory <u>V</u>aluation Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=302' style='font-weight:normal' id='_el56b1c99f17d785.00100709' accesskey='P'>Inventory <u>P</u>lanning Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=303' style='font-weight:normal' id='_el56b1c99f17e984.25893828' accesskey='C'>Stock <u>C</u>heck Sheets</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=304' style='font-weight:normal' id='_el56b1c99f17fba9.99609909' accesskey='S'>Inventory <u>S</u>ales Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=305' style='font-weight:normal' id='_el56b1c99f180d91.03711580' accesskey='G'><u>G</u>RN Valuation Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=306' style='font-weight:normal' id='_el56b1c99f181fb9.28213596' accesskey='U'>Inventory P<u>u</u>rchasing Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=307' style='font-weight:normal' id='_el56b1c99f1831c6.63724630' accesskey='M'>Inventory <u>M</u>ovement Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=308' style='font-weight:normal' id='_el56b1c99f184410.95680099' accesskey='O'>C<u>o</u>sted Inventory Movement Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=2&REP_ID=309' style='font-weight:normal' id='_el56b1c99f185648.66219691' accesskey='S'>Item <u>S</u>ales Summary Report</a><tr><td>
</table><table class='repclass' id='TAB_3' style='display:none' cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>Reports For Class:  Manufacturing</b></td></tr>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=3&REP_ID=401' style='font-weight:normal' id='_el56b1c99f186f98.28038982' accesskey='B'><u>B</u>ill of Material Listing</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=3&REP_ID=402' style='font-weight:normal' id='_el56b1c99f188180.72679464' accesskey='L'>Work Order <u>L</u>isting</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=3&REP_ID=409' style='font-weight:normal' id='_el56b1c99f189366.09178502' accesskey='W'>Print <u>W</u>ork Orders</a><tr><td>
</table><table class='repclass' id='TAB_4' style='display:none' cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>Reports For Class:  Dimensions</b></td></tr>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=4&REP_ID=501' style='font-weight:normal' id='_el56b1c99f18ac09.71319648' accesskey='S'>Dimension <u>S</u>ummary</a><tr><td>
</table><table class='repclass' id='TAB_5' style='display:none' cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>Reports For Class:  Banking</b></td></tr>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=5&REP_ID=601' style='font-weight:normal' id='_el56b1c99f18c4a3.47986700' accesskey='S'>Bank <u>S</u>tatement</a><tr><td>
</table><table class='repclass' id='TAB_6' style='display:none' cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>Reports For Class:  General Ledger</b></td></tr>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=701' style='font-weight:normal' id='_el56b1c99f18de05.70928389' accesskey='A'>Chart of <u>A</u>ccounts</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=702' style='font-weight:normal' id='_el56b1c99f18f024.71550230' accesskey='J'>List of <u>J</u>ournal Entries</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=704' style='font-weight:normal' id='_el56b1c99f190229.83418280' accesskey='T'>GL Account <u>T</u>ransactions</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=705' style='font-weight:normal' id='_el56b1c99f191434.64786031' accesskey='E'>Annual <u>E</u>xpense Breakdown</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=706' style='font-weight:normal' id='_el56b1c99f193b03.42488125' accesskey='B'><u>B</u>alance Sheet</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=707' style='font-weight:normal' id='_el56b1c99f194dd6.31402646' accesskey='P'><u>P</u>rofit and Loss Statement</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=708' style='font-weight:normal' id='_el56b1c99f195fe1.95516970' accesskey='B'>Trial <u>B</u>alance</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=709' style='font-weight:normal' id='_el56b1c99f1971b3.17095028' accesskey='X'>Ta<u>x</u> Report</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=710' style='font-weight:normal' id='_el56b1c99f1981a8.30772453'>Audit Trail</a><tr><td>
<tr><td><a class='repopts_link' href='/frontaccounting/reporting/reports_main.php?Class=6&REP_ID=_tax_details_cash' style='font-weight:normal' id='_el56b1c99f199142.05006817'>Tax Details (Cash Basis)</a><tr><td>
</table></td><td width='35%'><div id='rep_form'></div></td></tr></table><br><center><center><table width=20% cellpadding=2 cellspacing=0>
<tr>
<td align=center><a href='javascript:goBack();'>Back</a></td>
</tr>
</table></center>
</center><br></div></td></tr></table>
<table class=bottomBar2>
<tr><td class=bottomBarCell>03/02/2016 | 09:34</td>
<td id='hotkeyshelp'></td></td></tr></table>
</td></tr> </table>
</table>
<table align='center' id='footer'>
<tr>
<td align='center' class='footer'><a target='_blank' href='https://frontaccounting.com' tabindex='-1'><font color='#ffffff'>FrontAccounting 2.3.22 - Theme: default - </font></a></td>
</tr>
<tr>
<td align='center' class='footer'><a target='_blank' href='https://frontaccounting.com' tabindex='-1'><font color='#ffff00'>FrontAccounting</font></a></td>
</tr>
</table><br><br>
<script>
        _focus = '_el56b1c99f163177.24665220';
        _validate = [  ];
        var editors = [  ];
    </script>
<script type="text/javascript"><!--

var user = {
theme: '../themes/default/',
loadtxt: 'Requesting data...',
date: '03/02/2016',
datesys: 0,
datefmt: 1,
datesep: '/',
ts: ',',
ds: '.',
pdec : 2}

--></script>
</body></html>

Re: pdf large files printing problems

You probably have a large number of php variables. Increase the default 1000 to something bigger and raise the timeouts as well.
See this post and this post.