RE: desire your recommendation for our specific HTML -> PDF project

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Govinda [mailto:govinda.webdnatalk@xxxxxxxxx]
> Sent: Sunday, December 05, 2010 9:19 AM
> Cc: 'PHP-General List'
> Subject: Re:  desire your recommendation for our specific HTML -> PDF
> project
> 
> >>
> > Govinda,
> >
> > Have you/your team consider using pure CSS (using media screen &
> > print) for
> > formatting?  This may save you from having to deal with PDF (extra
> > codes -> slower performance, extra steps in save then print, extra
> > storage space just for temp save, etc... ) since they only need to
> > print as you mentioned.  If you use CSS pt (1/72 inch) unit, you
> > should get a pretty good precision.
> > IMO, I only see the need to save as/generate PDF if it's to create an
> > e-book, just to print to paper is not worth the time & effort. With
> > either method CSS/PDF, you'd still have to deal with the exact
> > formatting & layout (with PDF, you may have to twice - once for the
> > screen and again in PDF).
> 
> Tommy, thanks for taking the time to read my long post!  :-)
> 
> I tend to think like you too..  why make more work! ; I already got the
thing
> laid out nice for the browser..
> *but* the client is wary of the idea that every browser is going to have a
> slightly different rendition..and so we then have to either require use of
> one browser or another (and maintain the code as that browser version gets
> updated), or we have to code for lots of browsers.. and also code the
> mechanism by which either we sniff/detect which browser is being used..
> or else the user tells the page which rendition they need - before
printing.
> As they ponder all that, and the budget.. the client said, "it must be
PDF!"
> 
> -Govinda
> 

IIRC, the browser rendering difference should only be on the screen and with
available fonts on the client.  But for print, if you use pt, it should be
accurate.  The only issue I see with print is the font difference on printer
and in the client's system, that's the printer driver problem.  If you use
some special fonts, then you'll have to create a PDF so acrobat can attempt
to rasterize it.  Another option is just generate each label as a picture
via GD, ImageMagick, etc..., then no problems with browser differences or
font issues  :D.  If you do generate pics or PDF, beware of the quality of
printer's dpi vs. visual screen.  Any decent printer should be able to print
1200 dpi, or at least 600 dpi.

Here's the sample CSS print media since 1pt = 1/72 inch, assuming you're
using Avery labels with 1/4 inch margins:

body { width: 100%; min-width: 756pt; text-align: center; }
div.container { width: 576pt /*8 / (1/72) */; height: 756pt /* 10.5 inch /
(1/72) */;  overflow: hidden; }
div.label { float: left; width: 192pt /*576 / 3 columns */;  height: 72pt /*
1 inch height label */; overflow: hidden; }

For the font size, you should use pt also - 10 or 11 pt is readable on the
print out.  Each label is inside the div and it should fit nicely.  If you
do with CSS, you can permit the users to change size of label, as their need
may change, with calculations from PHP to get dimensions (width & height of
the label).  If anyone can tell visually the difference of 1pt or fractions
thereof, that person isn't normal :))
 
Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux