From: Rafael C. <raf...@gm...> - 2015-09-21 16:36:33
|
Hi Ricard, PDF, Nicola Asuni's TCPDF, R&OS's PHP Pdf Creation, and FPDF use dot-per-inch (72 dpi = 1 inch). I do not know Labels.php and PDFPrintLabels.php scripts, but other webERP scripts use dpi, not mm. I think the problem is that the code has changed from FPDF or PHP_Pdf_Creation to TCPDF, but there are remnants of the old code. Example of this is the height (Y pos): some code measure it from top, other from bottom, and there are functions that do this conversion. Also, you can NOT update TCPDF because there are compatibility problems (I tried this last year). For standardisation, I think page and label measurements must be stored in DB in dpi. But user interface could be different (user choice? mm, cm, inch, dot, ...). Best regards, Rafael. 2015-09-21 5:44 GMT-06:00 Pak Ricard <pak...@gm...>: > Hi Phil: > > I'm trying to make Labels.php and PDFPrintLabels.php work and I'm facing > some issues. > > 1) Units in PDF points or mm? > The title of the script states that all measurements are in PDF points, > but line 11 onwards are meausrements in mm (A4 is 297 x 210 mm, as example). > In PDFPrintLabels.php line 134 SELECT statement seems to transform DB > fields in mm to PDF points > In PDFPrintLabels.php line 164 and 165 seems to transform from mm to PDF > points > So not sure if page and label measurements must be done (and stored in DB) > in mm or in PDF points. Looks like it's in mm, but title text and comments > state differently. > > 2) Can't delete a field > Also, in Labels.php, trying to delete a field shows an error: > Not Acceptable! > An appropriate representation of the requested resource could not be found > on this server. This error was generated by Mod_Security. > It's the first time I get this error message, so no clue what it meant. > Are you using any specific library? > > 3) Problem positioning items > I am creating a label with Code, price and barcode. It seems like the > first field is properly positioned (stockid) but not price. Any combination > tried does not position it correctly. Not sure what's wrong. I want Code > and Price on the left half (code in top of the price) and barcode on the > right half. There is no way to position price below stockid. > > Here is the definition of label I'm using and the desired position of > fields (I supposed right measurements are in mm) > > INSERT INTO `labels` (`labelid`, `description`, `pagewidth`, `pageheight`, > `height`, `width`, `topmargin`, `leftmargin`, `rowheight`, `columnwidth`) > VALUES > (2, 'Zetags T-570', 86.2, 10.2, 10, 86, 0.01, 0.01, 10.1, 86.1); > > INSERT INTO `labelfields` (`labelfieldid`, `labelid`, `fieldvalue`, > `vpos`, `hpos`, `fontsize`, `barcode`) VALUES > (4, 2, 'itemcode', 7, 1, 4, 0), > (5, 2, 'price', 2, 1, 4, 0), > (6, 2, 'barcode', 1, 43, 20, 1); > > > Would be really appreciated if you could check it out. Thanks! > > > Regards, > Ricard > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > > |