php-general Digest 5 Aug 2010 12:29:38 -0000 Issue 6880

Topics (messages 307318 through 307323):

Converting HTML to PDF via PHP
        307318 by: Michael Calkins
        307319 by: Ashley Sheridan
        307321 by: Bastien Koert

mytrash mail thing
        307320 by: Ashley Sheridan
        307322 by: Daniel Brown

Re: PHP images server
        307323 by: Colin Guthrie

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
I have found various online tools that do this but nothing that has documented 
it as a tutorial so I can understand it.  I found the html_to_pdf.inc.php 
script that is entirely undocumented so I am not sure how to use it exactly. 
I am trying to export generated HTML (an invoice for a customer) to a saveable 
PDF that is downloaded.  Any ideas?

From,Michael [email protected]

                                          

--- End Message ---
--- Begin Message ---
On Wed, 2010-08-04 at 17:33 -0700, Michael Calkins wrote:

> I have found various online tools that do this but nothing that has 
> documented it as a tutorial so I can understand it.  I found the 
> html_to_pdf.inc.php script that is entirely undocumented so I am not sure how 
> to use it exactly. 
> I am trying to export generated HTML (an invoice for a customer) to a 
> saveable PDF that is downloaded.  Any ideas?
> 
> From,Michael [email protected]
> 
>                                         


As far as I'm aware, it's not as simple as it seems. Basically, HTML is
subject to interpretation by the user agent (browser) so doesn't look
consistent on all platforms. A PDF is meant to follow a fairly rigid
format that defines exactly how the output should be displayed (as it's
a presentational format)

What you could do though, if you're already producing the HTML output,
is to use the FPDF class to create the PDF you need, with appropriate
calls made from within your existing PHP code.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Wed, Aug 4, 2010 at 6:06 PM, Ashley Sheridan
<[email protected]> wrote:
> On Wed, 2010-08-04 at 17:33 -0700, Michael Calkins wrote:
>
>> I have found various online tools that do this but nothing that has 
>> documented it as a tutorial so I can understand it.  I found the 
>> html_to_pdf.inc.php script that is entirely undocumented so I am not sure 
>> how to use it exactly.
>> I am trying to export generated HTML (an invoice for a customer) to a 
>> saveable PDF that is downloaded.  Any ideas?
>>
>> From,Michael [email protected]
>>
>>
>
>
> As far as I'm aware, it's not as simple as it seems. Basically, HTML is
> subject to interpretation by the user agent (browser) so doesn't look
> consistent on all platforms. A PDF is meant to follow a fairly rigid
> format that defines exactly how the output should be displayed (as it's
> a presentational format)
>
> What you could do though, if you're already producing the HTML output,
> is to use the FPDF class to create the PDF you need, with appropriate
> calls made from within your existing PHP code.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

You can also look at dompdf from digitaljunkies.ca

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
Hi,

Please can whoever is using that [email protected] system please remove it
from this list or remove yourself? Every email I now send to the list is
followed up by a message from this, which from my point of view is
essentially spam being sent to me. If you sign up to the php mailing
list, expect to receive emails from it. If I even at least knew who was
responsible for these emails I could remove them from any replies to all
made to the list.

Incidentally, there is a valid reason why I use reply to all instead of
reply to list. Some people post to the list without signing up to it,
and expect any replies to have them copied in as recipients. As such, a
reply to list option just doesn't suit the population of this particular
list.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Wed, Aug 4, 2010 at 21:18, Ashley Sheridan <[email protected]> wrote:
> Hi,
>
> Please can whoever is using that [email protected] system please remove it
> from this list or remove yourself? Every email I now send to the list is
> followed up by a message from this, which from my point of view is
> essentially spam being sent to me. If you sign up to the php mailing
> list, expect to receive emails from it. If I even at least knew who was
> responsible for these emails I could remove them from any replies to all
> made to the list.

    I'm checking to see if I get one as well (and expect that to be
the case).  I will try to track down and remove the address from the
list this week.

-- 
</Daniel P. Brown>
UNADVERTISED DEDICATED SERVER SPECIALS
SAME-DAY SETUP
Just ask me what we're offering today!
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/

--- End Message ---
--- Begin Message ---
'Twas brillig, and Jean-Michel Philippon-Nadeau at 04/08/10 16:48 did
gyre and gimble:
> Hi List,
> 
> My website uses a lot of external images coming from many different
> websites. Those images are sometimes small, sometimes big, and to
> reduce the loading time of my pages and for better uniformity, I've
> built a small PHP images server that resizes to a predefined set of
> dimensions the images if necessary. To save on CPU usage, the resized
> version is stored on Amazon AWS.
> 
> When requesting an image of a specific size, if the resized image
> exists on AWS, that image is used. The images server then redirects
> the browser to the AWS URL.
> 
> I don't believe having 80 redirections is a very clean solution so, my
> question is: How can I optimize my process while keeping the load on
> Amazon's servers?


Presumably you generate the links to the files to put into HTML or CSS
at some point?

Rather than check if an appropriate sized image is available then the
image is requested, why not check when you generate the link to the the
image? If when you generate the link it is NOT available, do the
necessary stuff to generate it and upload to AWS, then carry on.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--- End Message ---

Reply via email to