Wiki source for Utf8Pdf


Show raw source

====Transition to UTF-8====

===A bit of Background, review the developers mailing list for more===

TCPDF class allows CID fonts to be used (visit http://www.civicom.eu/cuestore/pdf-cidfonts.htm for details) - basic CID fonts are available in acrobat reader that will allow utf-8 pdfs to be produced without having to embed (bundle) the excessively large fonts within the pdf which defeat the webERP goal of enabling the system to run in very low bandwidth environments.

Javier has got things working with TCPDF. Now, to do things better and prepare WebERP to the stage where papersize may be user defined, all PDFs need to be modified slightly:

===Work Required===

In the utf8 branch of SVN:

~ ===1=== Put $FontSize assignments after $pdf->addInfo calls
~ ===2=== Ensure addInfo calls have capitalised 'I' not lower case 'i'.
~ ===3=== Replace changes in font between normal and bold such as
%%$pdf->selectFont('./fonts/Helvetica-Bold.afm');%%
to
%%$pdf->setFont('','B');%%
to turn on bold type face in the default font and replace the following lines:
%%$pdf->selectFont('./fonts/Helvetica.afm');%%
to
%%$pdf->setFont('','');%%
to turn off bold type face in the default font
~ ===4=== Remove references to the output function that are only attempting to get the length of the pdf (the ouput function in TCPDF creates the pdf - not just creating a pdf string - so we can't test for its length anymore). Change the code to bail out of the pdf creation process at the point when we know if there are no records returned from the sql using code like:
%%
if(DB_num_rows($DB_result)==0) {
$Title = _('Report name Error Report');
include ('includes/header.inc');
prnMsg(_('There is nothing to report on based on the selections made'),'error');
include ('includes/footer.inc');
exit;
}
%%
~ ===5=== Correct the syntax of the pdf creation method to make calls to the $pdf->OutputD($_SESSION['DatabaseName'] . '_' .'ReportName_' . date('Y-m-d').'.pdf');
~ ===6=== Delete the http header code - this is now sent automatically by TCPDF
~ ===7=== Where previously we used the CVS $Revsion substitution variable this is not available in svn and we need to change it to $Id$ inside the existing comment
~ ===8=== Add the line %%$pdf->__destruct();%% after the %%$pdf->OutputD($_SESSION['DatabaseName'] . '_' .'ReportName_' . date('Y-m-d').'.pdf');%% to free memory

*Javier*: Following is the list that I have been making during these last months, it has three parts; I will carry on my back the first 2 parts and have made 2 examples of 3rd part: the first AgedDebtors and PDFPriceList.

**ReportWriter**
++The folder /reportwriter: Javier++


** PDF Scripts That Make Use of class.pdf.php directly (7 scripts) **
++InventoryPlanning.php: Javier++
++InventoryPlanningPrefSupplier.php: Javier++
++MailInventoryValuation.php: Javier++
++PrintCustOrder.php: Javier++
++PrintCustTrans.php: Javier++
++PrintCustTransPortrait.php: Javier++
SalesAnalRepts.php - SalesAnalisis_UserDefined.php (Outputs the PDF) - PDFSalesAnalysis.inc (creates PDF) - PDFSalesAnalPageHeader.inc


** PDF Scripts That Make Use of PDFStarter.php (47 scripts) **
++AgedDebtors.php: Javier++
++AgedSuppliers.php: Uldis++
++BOMExtendedQty.php: Uldis++
++BOMIndented.php: Uldis++
++BOMIndentedReverse.php: Uldis++
++BOMListing.php: Uldis++
++DebtorsAtPeriodEnd.php: Uldis++
++GLBalanceSheet.php: Uldis++
++GLProfit_Loss.php: Phil++
++GLTagProfit_Loss.php: Phil++
++GLTrialBalance.php: Phil++
++InventoryQuantities.php: Phil++
++InventoryValuation.php: Phil++
++MRPPlannedPurchaseOrders.php: Phil++
++MRPPlannedWorkOrders.php: Phil++
++MRPReport.php: Uldis++
++MRPReschedules.php: Uldis++
++MRPShortages.php: Uldis++
++OutstandingGRNs.php: Uldis++
++PDFBankingSummary.php: Uldis ++
++PDFChequeListing.php: Uldis ++
++PDFCustomerList.php: Uldis ++
++PDFDeliveryDifferences.php: Uldis ++
++PDFDIFOT.php: Uldis ++
++PDFGrn.php: Uldis++
++PDFLowGP.php: Uldis++
++PDFOrdersInvoiced.php: Uldis++
++PDFOrderStatus.php: Uldis++
++PDFPriceList.php: Javier++
++PDFQuotation.php: Uldis++
++PDFStockCheckComparison.php: Uldis++
++PDFStockLocTransfer.php: Uldis++
++PDFStockNegatives.php: Uldis++
++PDFStockTransfer.php: Uldis++
++PDFTopItems.php: Uldis++
++PO_PDFPurchOrder.php: Uldis++
++PrintCheque.php: Uldis ++
++PrintCustOrder_generic.php: Uldis++
++PrintCustStatements.php: Uldis++
++PrintSalesOrder_generic.php: Uldis++
++ReorderLevel.php: Uldis++
++StockCheck.php: Phil ++
++StockDispatch.php: Phil ++
++SupplierBalsAtPeriodEnd.php: Phil ++
++SuppPaymentRun.php: Phil++
++SuppPriceList.php: Phil ++
++Tax.php: Phil++
Valid XHTML :: Valid CSS: :: Powered by WikkaWikiGet webERP Accounting & Business Management at SourceForge.net. Fast, secure and Free Open Source software downloads