php-general Digest 11 Feb 2011 22:42:23 -0000 Issue 7177

Topics (messages 311245 through 311252):

Re: Bar Charts in PDFs
        311245 by: Mattias Geniar
        311247 by: Richard Quadling
        311249 by: sono-io.fannullone.us
        311250 by: Robert Cummings
        311251 by: Alejandro Michelin Salomon

Re: ob_flush, does it cause data to be sent over the wire immediately?
        311246 by: Tolas Anon

[SOLVED] Re: [PHP] curl_exec won't return (any data)
        311248 by: Tolas Anon

Help! Made a boo-boo encrypting credit cards
        311252 by: Brian Dunning

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi Tom,

Have a look at the library called 'pChart':
http://pchart.sourceforge.net/
While it's a bit old, it generates very nice looking (anti aliased)
charts, using the default GD library.

Regards,
Mattias

-----Original Message-----
From: Tom Barrett [mailto:t...@miramedia.co.uk] 
Sent: vrijdag 11 februari 2011 10:55
To: php-gene...@lists.php.net
Subject: [PHP] Bar Charts in PDFs

Hi

I need to generate some PDF reports (1000s). Part of the report is a set
of
bar charts (the results of a questionnaire). Each question has the same
5
answers (v.bad, bad, ok ,good, v.good) and the chart is the %
distribution
of the answers.

My plan is to create a HTML version, using "some graph drawing"* (saving
a
copy of the HTML to disk), creating a PDF version using html2pdf (saving
a
copy to disk and emailing to the recipient).

I think html2pdf can handle this. But I have not had much success
finding
something to draw my graphs. Any (free) simple libraries out there I
could
be pointed towards?

Thanks!
Tom

--- End Message ---
--- Begin Message ---
On 11 February 2011 10:08, Mattias Geniar <matt...@nucleus.be> wrote:
> Hi Tom,
>
> Have a look at the library called 'pChart':
> http://pchart.sourceforge.net/
> While it's a bit old, it generates very nice looking (anti aliased)
> charts, using the default GD library.
>
> Regards,
> Mattias
>
> -----Original Message-----
> From: Tom Barrett [mailto:t...@miramedia.co.uk]
> Sent: vrijdag 11 februari 2011 10:55
> To: php-gene...@lists.php.net
> Subject: [PHP] Bar Charts in PDFs
>
> Hi
>
> I need to generate some PDF reports (1000s). Part of the report is a set
> of
> bar charts (the results of a questionnaire). Each question has the same
> 5
> answers (v.bad, bad, ok ,good, v.good) and the chart is the %
> distribution
> of the answers.
>
> My plan is to create a HTML version, using "some graph drawing"* (saving
> a
> copy of the HTML to disk), creating a PDF version using html2pdf (saving
> a
> copy to disk and emailing to the recipient).
>
> I think html2pdf can handle this. But I have not had much success
> finding
> something to draw my graphs. Any (free) simple libraries out there I
> could
> be pointed towards?
>
> Thanks!
> Tom
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

For the PDF production, I'd recommend looking at fpdf [1]. A free PHP
class that doesn't use any libraries.

It can easily take the image you've created using Mattias's suggestion.

I use the fpdf class to take fax documents and add various report data
to it and subsequent pages. All fairly simple stuff.

Regards,

Richard.

[1] http://www.fpdf.org/

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
On Feb 11, 2011, at 2:08 AM, Mattias Geniar wrote:

> Have a look at the library called 'pChart':
> http://pchart.sourceforge.net/
> While it's a bit old...

        Actually, it's been updated to v2.1 now.  It looks pretty nice.

http://www.pchart.net/

Marc

--- End Message ---
--- Begin Message ---
On 11-02-11 11:19 AM, sono...@fannullone.us wrote:
On Feb 11, 2011, at 2:08 AM, Mattias Geniar wrote:

Have a look at the library called 'pChart':
http://pchart.sourceforge.net/
While it's a bit old...

        Actually, it's been updated to v2.1 now.  It looks pretty nice.

http://www.pchart.net/

Sweeeeeeet... good to know. I recently used this and had to hack in support for missing features (mostly different line types for each data set). Hopefully there's better support for that now.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
Tom:

You can try:

http://www.tcpdf.org/ to generate pdf.
And http://jpgraph.net/ To generate chart.

EX: to add a image to a pdf document:

$pdf->Image( '/home/peter/test.png',
             127.78, 15,          // left and right
             74.93, 6.42,         // width and height
            'PNG', '', 'T', false, 300 );

With this tcpdf i create a legal documents for Brazilian government.

Alejandro MS
-----Mensagem original-----
De: Tom Barrett [mailto:t...@miramedia.co.uk] 
Enviada em: sexta-feira, 11 de fevereiro de 2011 06:55
Para: php-gene...@lists.php.net
Assunto: [PHP] Bar Charts in PDFs

Hi

I need to generate some PDF reports (1000s). Part of the report is a set of
bar charts (the results of a questionnaire). Each question has the same 5
answers (v.bad, bad, ok ,good, v.good) and the chart is the % distribution
of the answers.

My plan is to create a HTML version, using "some graph drawing"* (saving a
copy of the HTML to disk), creating a PDF version using html2pdf (saving a
copy to disk and emailing to the recipient).

I think html2pdf can handle this. But I have not had much success finding
something to draw my graphs. Any (free) simple libraries out there I could
be pointed towards?

Thanks!
Tom


--- End Message ---
--- Begin Message ---
On Fri, Feb 11, 2011 at 4:05 AM, Tolas Anon <tolas...@gmail.com> wrote:
> Hi..
>
> For my curl_exec problem,
> http://readlist.com/lists/lists.php.net/php-general/16/81195.html
> http://curl.haxx.se/mail/lib-2011-02/0101.html
>
> I need to know if this simple test will cause data to be sent every 25
> seconds _over the wire_.
>
> <?php
> set_time_limit (0);
> error_reporting (E_ALL);
> for ($i=0; $i<((3600+1800)/25); $i++) {
>        echo '.';
>        ob_flush();
>        sleep (25);
> };
> echo "wanted-data";
> ?>
>
> reason; i just can't get my media import routines that only send
> sporadic status messages to work for big video files.
>

well, first off i should be using php:flush() instead of
php:ob_flush() in my simple test.

second;
http://www.php.net/manual/en/function.flush.php :

....
Several servers, especially on Win32, will still buffer the output
from your script until it terminates before transmitting the results
to the browser.
.....


aargh..

well, i'll have to dig deep here.

will inform you of any relevant progress, digest style

--- End Message ---
--- Begin Message ---
from    Tolas Anon <tolas...@gmail.com>
to      libcurl development <curl-libr...@cool.haxx.se>
date    Fri, Feb 11, 2011 at 5:09 PM
subject Re: php curl_exec won't return any data, libcurl-7.21.3.0, php
5.3.4, WampServer2.1d-x64.exe
mailed-by       gmail.com
        
On Fri, Feb 11, 2011 at 1:32 PM, Daniel Stenberg <dan...@haxx.se> wrote:
> On Fri, 11 Feb 2011, Tolas Anon wrote:
>
>>> It is also very easy for an application to enable the options as I've
>>> shown.
>>
>> Just not for the platforms i use, apparently.. :(
>
> Why not? A quick search for "tcp keepalive windows" shows this:
> http://msdn.microsoft.com/en-us/library/ms819735.aspx


BUYAKAA! This fixed my problem in the simple test AND in my application!
No need to send keep-alive bytes on the text/html level either.

I just added the "KeepAliveTime" setting with windows 7 regedit.exe in
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/Tcpip, as a
REG_DWORD value, set it to decimal 25000 (so 25 seconds), rebooted,
and it all works as i want it now..

Note that windows registry entries key names are case-sensitive, wrong
casing and they'll be deleted on restart.

Lots of thanks, Daniel. I would've never solved this on my own..

I'll make an entry in the php.net website "comments" about this.

--- End Message ---
--- Begin Message ---
Hey all -

I'm using mcrypt to store credit cards into MySQL. About 90% of them decrypt 
fine, but about 10% decrypt as nonsense ("b1�\�JEÚU�A���" is a good example). 
Maybe there is a character that appears in about 10% of my encryptions that's 
not being encoded properly???

// Encryption is set up at the top of the script:
$crypto = mcrypt_module_open('rijndael-256', '', 'ofb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($crypto), MCRYPT_DEV_RANDOM);
$ks = mcrypt_enc_get_key_size($crypto);
$key = substr(md5('my_funky_term'), 0, $ks);

// When the card number is collected by the form, it's encrypted:
$cc_number = addslashes($_POST['cc_number']);
mcrypt_generic_init($crypto, $key, $iv);
$cc_encrypt = mcrypt_generic($crypto, $cc_number);
mcrypt_generic_deinit($crypto);

// This is written to the database:
$query = "update accounts set cc_encrypt='$cc_encrypt', encrypt_iv='$iv', 
other_fields='$other_stuff' where id='$account_id' limit 1";
$result = mysql_query($query) or die(mysql_error());

Both the cc_encrypt and encrypt_iv fields are tinytext, latin1_swedish_ci, 
MyISAM, MySQL 5.0.91

In another script, when I retrieve, I first set it up at the top of the script 
exactly like step #1 above, then retrieve it like this:

mcrypt_generic_init($crypto, $key, $row['encrypt_iv']);
$cc_number = trim(mdecrypt_generic($crypto, $row['cc_encrypt']));
mcrypt_generic_deinit($crypto);

Most of them are good, a few of them are bad. Can anyone see anything I'm doing 
wrong or a case I'm not covering? Thanks much.


--- End Message ---

Reply via email to