php-general Digest 27 Dec 2006 21:38:53 -0000 Issue 4537
php-general Digest 27 Dec 2006 21:38:53 - Issue 4537 Topics (messages 246231 through 246244): Re: GD 2.0.28 + PHP 4.4.2 + pixelation :( 246231 by: Peter Lauri 246232 by: Jochem Maas 246233 by: Steven Macintyre PDFlib problem 246234 by: Rosen 246236 by: Peter Lauri 246237 by: Jochem Maas 246239 by: Rosen 246241 by: Peter Lauri 246242 by: Jochem Maas Re: scripting process doesn't function 246235 by: Jochem Maas 246243 by: tedd Simple PDF manipulation 246238 by: Brian Dunning 246240 by: tedd 246244 by: Brian Dunning 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: php-general@lists.php.net -- ---BeginMessage--- Hi, imagecopyresampled might help you... I use that and it works without problems. /Peter -Original Message- From: Steven Macintyre [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 27, 2006 10:17 AM To: php-general@lists.php.net Subject: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :( Hi All, I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc I have tried all fixes ... to no avail I have one image here 1280 x 960 (150 dpi) 24 depth When using the following it pixelates ... function createthumb($name,$filename,$new_w,$new_h) { $system=explode(.,$name); $src_img=imagecreatefromjpeg($name); $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); imagejpeg($dst_img,$filename); imagedestroy($dst_img); imagedestroy($src_img); } Which I am of course calling with createthumb($add,'../pics/'.$largeval,350,263); Now ... afaik my new sizes are proportional to the big ones ... but it pixelates :( However, Using an image 1600 x 1200 (96 dpi) 24 depth it works and there is no pixilation Can someone perhaps assist now? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Steven Macintyre wrote: Hi All, I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc which should be the correct; use copyimageresampled() I have tried all fixes ... to no avail I have one image here 1280 x 960 (150 dpi) 24 depth DPI is completely irrelevant. the '24 depth' sounds like your using a PNG as input rather that a JPEG (which your function expects) your not making sure that the new width height are always integers. use intval() or ceil() or floor() (depending on your your and the context)... I have no idea what happens if you pass floats (or non-numeric data) in the relevant arguments of image*() functinons but I'm guessing it *could* lead to unexplained weirdness of some sort. read the man page for imagejpeg(): http://php.net/manual/en/function.imagejpeg.php take note of the third argument, personally I always set it to 100, anything less and clients have a tendency to start complaining about image quality. When using the following it pixelates ... function createthumb($name,$filename,$new_w,$new_h) { $system=explode(.,$name); $src_img=imagecreatefromjpeg($name); $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); try: imagecopyresampled(); imagejpeg($dst_img,$filename); imagedestroy($dst_img); imagedestroy($src_img); } Which I am of course calling with createthumb($add,'../pics/'.$largeval,350,263); Now ... afaik my new sizes are proportional to the big ones ... but it pixelates :(
[PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
Hi All, I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc I have tried all fixes ... to no avail I have one image here 1280 x 960 (150 dpi) 24 depth When using the following it pixelates ... function createthumb($name,$filename,$new_w,$new_h) { $system=explode(.,$name); $src_img=imagecreatefromjpeg($name); $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); imagejpeg($dst_img,$filename); imagedestroy($dst_img); imagedestroy($src_img); } Which I am of course calling with createthumb($add,'../pics/'.$largeval,350,263); Now ... afaik my new sizes are proportional to the big ones ... but it pixelates :( However, Using an image 1600 x 1200 (96 dpi) 24 depth it works and there is no pixilation Can someone perhaps assist now? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
Hi, imagecopyresampled might help you... I use that and it works without problems. /Peter -Original Message- From: Steven Macintyre [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 27, 2006 10:17 AM To: php-general@lists.php.net Subject: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :( Hi All, I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc I have tried all fixes ... to no avail I have one image here 1280 x 960 (150 dpi) 24 depth When using the following it pixelates ... function createthumb($name,$filename,$new_w,$new_h) { $system=explode(.,$name); $src_img=imagecreatefromjpeg($name); $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); imagejpeg($dst_img,$filename); imagedestroy($dst_img); imagedestroy($src_img); } Which I am of course calling with createthumb($add,'../pics/'.$largeval,350,263); Now ... afaik my new sizes are proportional to the big ones ... but it pixelates :( However, Using an image 1600 x 1200 (96 dpi) 24 depth it works and there is no pixilation Can someone perhaps assist now? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
Steven Macintyre wrote: Hi All, I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc which should be the correct; use copyimageresampled() I have tried all fixes ... to no avail I have one image here 1280 x 960 (150 dpi) 24 depth DPI is completely irrelevant. the '24 depth' sounds like your using a PNG as input rather that a JPEG (which your function expects) your not making sure that the new width height are always integers. use intval() or ceil() or floor() (depending on your your and the context)... I have no idea what happens if you pass floats (or non-numeric data) in the relevant arguments of image*() functinons but I'm guessing it *could* lead to unexplained weirdness of some sort. read the man page for imagejpeg(): http://php.net/manual/en/function.imagejpeg.php take note of the third argument, personally I always set it to 100, anything less and clients have a tendency to start complaining about image quality. When using the following it pixelates ... function createthumb($name,$filename,$new_w,$new_h) { $system=explode(.,$name); $src_img=imagecreatefromjpeg($name); $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); try: imagecopyresampled(); imagejpeg($dst_img,$filename); imagedestroy($dst_img); imagedestroy($src_img); } Which I am of course calling with createthumb($add,'../pics/'.$largeval,350,263); Now ... afaik my new sizes are proportional to the big ones ... but it pixelates :( However, Using an image 1600 x 1200 (96 dpi) 24 depth it works and there is no pixilation Can someone perhaps assist now? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
imagecopyresampled might help you... I use that and it works without problems. Hi Peter, I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc I have tried your suggestion with the same results ... that is what I was using first :( S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDFlib problem
Hi, I have problem with PDFlib on Windows 2000, PHP 5.2.0 and Apache 2.2.3 When I try to execute: $p = new PDFlib(); in the Apache log I receive: PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key 'objorient' [.] [notice] Parent: child process exited with status 99 -- Restarting. And nothing happens - I receive Problem loading page. Can someone help? Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDFlib problem
Try this one: http://pecl.php.net/bugs/bug.php?id=9491edit=1 /Peter www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free -Original Message- From: Rosen [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 27, 2006 2:58 PM To: php-general@lists.php.net Subject: [PHP] PDFlib problem Hi, I have problem with PDFlib on Windows 2000, PHP 5.2.0 and Apache 2.2.3 When I try to execute: $p = new PDFlib(); in the Apache log I receive: PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key 'objorient' [.] [notice] Parent: child process exited with status 99 -- Restarting. And nothing happens - I receive Problem loading page. Can someone help? Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDFlib problem
Rosen wrote: Hi, I have problem with PDFlib on Windows 2000, PHP 5.2.0 and Apache 2.2.3 When I try to execute: $p = new PDFlib(); in the Apache log I receive: PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key 'objorient' [.] [notice] Parent: child process exited with status 99 -- Restarting. And nothing happens - I receive Problem loading page. Can someone help? read this (it might help): http://pecl.php.net/bugs/bug.php?id=9491edit=1 basically, if your lucky, all you need to do is update PDFlib to a newer version. Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] scripting process doesn't function
Geert T wrote: Hi, I have made some script that process the users input, and validates the input and sends it back. But it doesn't work very well, in fact it doesn't work at all. I am only able to see and input my name and such in the html form, but the php part doesn't do it's job. what exactly doesn't it do that you expect it to? I have looked over the scripts thousands of times, but couldn't find the problem, really. Here is the script plus 2 .inc files; Hoping for some replies and answers, Thanks in advance! PS: if this script is a bit messy to read, .. it's because your not using plain text as your email format - highly annoying. I have included them in this mail seperately. ?php /* Script name: addressForm.inc * Description: Script displays a form. */ echo html headtitleCustomer Address/title/head body; echo p align='center' form action='validateForm.php' method='POST' is 'validateForm.php' actually correct? leave the 'action' blank to have it post to the current URL (regardless of what it is. table width='95%' border='0' cellspacing='0' cellpadding='2'\n; foreach($labels as $field=$value) { if(isset($_POST[$field])) { $value = $_POST[$field]; } else { $value = ; } echo trtd align='right'{$labels[$field]}/br/td tdinput type='text' name'$field' size='65' maxlength='65' value='$value' /td /tr; } echo /table div align='center' pinput type='Submit' name='Submit' value='Submit Address'/p/div /form; ? /body/html ?php I would consider an include file for a single, static, 7 item array rather over-kill - not that it should be a problem either! /* Script name: info.inc * Description: creates an array of labels for use in a * form. */ $labels = array( firstName= First Name:, midName=Middle Name:, lastName=Last Name:, street=Street Address:, city=City:, state=State:, zipcode=Zipcode:); ? ?php /* Script name: validateForm * Description: Displays and validates a form that * collects a name and address. */ have you tried adding the following line to see what is being posted?: var_dump($_POST, $_GET); include(info.inc); #6 # ## First display of empty form ## # if(!isset($_POST['Submit']))#10 { include(addressForm.inc); } ## Check information when form is submitted. Build ## ## arrays of blank and incorrectly formatted fields. ## ## If any errors are found, display error messages ## ## and redisplay form. If no errors found, display ## ## the submitted information.## else #21 { foreach($_POST as $field=$value) #23 { if(empty($_POST[$field])) #25 { if($field !=midName) { $blanks[$field] = blank; #29 } } else #33 { $value = trim($value); if($field != zipcode) { if(!ereg(^[A-Za-z0-9' .-]{1,65}$,$value)) { $formats[$field] = bad; } } elseif($field == zipcode) { if(!ereg(^[0-9]{5}(\-[0-9]{4})?,$value)) { $formats[$field] = bad; } } } } #51 ### if any fields were not okay, display error ### ### message and redisplay form ### DONT STICK '@' IN FRONT OF FUNCTIONS (unless you *really* know what you are doing - if that was the case I garantee you wouldn't have needed post your question) if (@sizeof($blanks) 0 or @sizeof($formats) 0)#54 { if (@size($blanks) 0) { echo bYou didn't fill in one or more required fields. You must enter:/bbr; foreach($blanks as $field = $value) { echo nbsp;nbsp;nbsp;{$labels[$field]}br; } } if (@sizeof($formats) 0) { echo bOne or more fields have information that appears to be incorrect. Correct the format for:/bbr; foreach($formats as $field = $value) { echo nbsp;nbsp;nbsp;{$labels[$field]}br; } } echo hr; include(adressForm.inc); } else { ### If no errors in the form, display the ### ### name and address submitted by user ### echo htmlheadtitleName and Address /title/headbody\n; foreach($_POST as $field=$value) { if($field != Submit) { echo {$labels[$field]} $valuebr\n; } } echo /body/html; } } ? Met MSN Spaces kun je per e-mail je weblog bijwerken. Publiceer leuke verhalen, foto's en meer! Het is gratis! Het is gratis! http://clk.atdmt.com/MSN/go/msnnksac003001msn/direct/01/?href=http://www.imagine-msn.com/spaces
[PHP] Simple PDF manipulation
Let's say I have a complicated PDF document, like a Christmas card, that was made in Illustrator -- too complicated to easily create from scratch using PDFlib. Is there a way to use PHP make simple text changes - like changing Dear XXX to Dear John? I've opened the files with a text editor and cannot locate the simple text, it appears to be encoded somehow. The PDF has no security or encryption in it. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDFlib problem
Thank you all, But from where I can download new version ( binary) of PDFlib for windows ? Rosen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have problem with PDFlib on Windows 2000, PHP 5.2.0 and Apache 2.2.3 When I try to execute: $p = new PDFlib(); in the Apache log I receive: PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key 'objorient' [.] [notice] Parent: child process exited with status 99 -- Restarting. And nothing happens - I receive Problem loading page. Can someone help? Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple PDF manipulation
At 6:32 AM -0800 12/27/06, Brian Dunning wrote: Let's say I have a complicated PDF document, like a Christmas card, that was made in Illustrator -- too complicated to easily create from scratch using PDFlib. Is there a way to use PHP make simple text changes - like changing Dear XXX to Dear John? I've opened the files with a text editor and cannot locate the simple text, it appears to be encoded somehow. The PDF has no security or encryption in it. Thanks Brian: I'm not saying that there is/isn't a way to do this, but I tried and failed. In my investigation, I found that the insides of a PDF file are not conducive to a simple search and replace mechanism. The text is encoded in some fashion that is not easy to decode and reassemble. The solution I came up with was to combine the existing PDF file with my coding and write over (on top of) the old to produce the new PDF that I wanted. In your case, take your Christmas Card with a big space where xxx appears and then write over that space with John in your new code. I wish someone would show me a simpler way to do this. hth's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PDFlib problem
http://www.pdflib.com/download/pdflib-family/pdflib-6/ Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free -Original Message- From: Rosen [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 27, 2006 4:40 PM To: php-general@lists.php.net Subject: [PHP] Re: PDFlib problem Thank you all, But from where I can download new version ( binary) of PDFlib for windows ? Rosen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have problem with PDFlib on Windows 2000, PHP 5.2.0 and Apache 2.2.3 When I try to execute: $p = new PDFlib(); in the Apache log I receive: PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key 'objorient' [.] [notice] Parent: child process exited with status 99 -- Restarting. And nothing happens - I receive Problem loading page. Can someone help? Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PDFlib problem
Rosen wrote: Thank you all, But from where I can download new version ( binary) of PDFlib for windows ? STFW: you could manage to type the words 'PDFlib download windows binary' (or something similar) into the search box on the home page at google.com (or whatever search engine you prefer)??? http://www.pdflib.com/download/pdflib-family/pdflib-7/ Rosen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have problem with PDFlib on Windows 2000, PHP 5.2.0 and Apache 2.2.3 When I try to execute: $p = new PDFlib(); in the Apache log I receive: PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key 'objorient' [.] [notice] Parent: child process exited with status 99 -- Restarting. And nothing happens - I receive Problem loading page. Can someone help? Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] scripting process doesn't function
leave the 'action' blank to have it post to the current URL (regardless of what it is. Duh? This is the new thing I learned today. I've been messing around with _SERVER[SCRIPT_NAME] and _SERVER[PHP_SELF] just to make sure the code is portable -- and then you point out something I've been using for years with html. Sometimes the details shadow what's in plain sight. Thanks. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple PDF manipulation
Interesting, that's a good idea. I was not aware that it was possible to load an existing PDF into memory and then add stuff to it. On Dec 27, 2006, at 7:28 AM, tedd wrote: At 6:32 AM -0800 12/27/06, Brian Dunning wrote: Let's say I have a complicated PDF document, like a Christmas card, that was made in Illustrator -- too complicated to easily create from scratch using PDFlib. Is there a way to use PHP make simple text changes - like changing Dear XXX to Dear John? I've opened the files with a text editor and cannot locate the simple text, it appears to be encoded somehow. The PDF has no security or encryption in it. Thanks Brian: I'm not saying that there is/isn't a way to do this, but I tried and failed. In my investigation, I found that the insides of a PDF file are not conducive to a simple search and replace mechanism. The text is encoded in some fashion that is not easy to decode and reassemble. The solution I came up with was to combine the existing PDF file with my coding and write over (on top of) the old to produce the new PDF that I wanted. In your case, take your Christmas Card with a big space where xxx appears and then write over that space with John in your new code. I wish someone would show me a simpler way to do this. hth's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple PDF manipulation
Yeah, this is exactly what we do at my work. We have a license for PDFLib and essentually we load blank forms and then say take this text and position it at this location. Kind of like putting words on a clear piece of acetate and overlaying it on top of a piece of paper. If I recall, we had issues trying to do this with fpdf and some other PHP PDF libraries, but PDFlib allowed us to do it and it's what we've used ever since. Actually, tedd.. did you use PDFlib or another library or maybe something in PHP5 (that we don't use yet)? We may be moving off of PDFlib at some point and I may be looking for alternatives. This is the main function we need. Ignorant question, but I havn't even thought of researching it yet and figured I'd ask while the topic was at hand. -TG = = = Original message = = = Interesting, that's a good idea. I was not aware that it was possible to load an existing PDF into memory and then add stuff to it. On Dec 27, 2006, at 7:28 AM, tedd wrote: At 6:32 AM -0800 12/27/06, Brian Dunning wrote: Let's say I have a complicated PDF document, like a Christmas card, that was made in Illustrator -- too complicated to easily create from scratch using PDFlib. Is there a way to use PHP make simple text changes - like changing Dear XXX to Dear John? I've opened the files with a text editor and cannot locate the simple text, it appears to be encoded somehow. The PDF has no security or encryption in it. Thanks Brian: I'm not saying that there is/isn't a way to do this, but I tried and failed. In my investigation, I found that the insides of a PDF file are not conducive to a simple search and replace mechanism. The text is encoded in some fashion that is not easy to decode and reassemble. The solution I came up with was to combine the existing PDF file with my coding and write over (on top of) the old to produce the new PDF that I wanted. In your case, take your Christmas Card with a big space where xxx appears and then write over that space with John in your new code. I wish someone would show me a simpler way to do this. hth's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple PDF manipulation
FPDF might do the same thing, won't it? Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 27, 2006 11:11 PM To: php-general@lists.php.net Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Simple PDF manipulation Yeah, this is exactly what we do at my work. We have a license for PDFLib and essentually we load blank forms and then say take this text and position it at this location. Kind of like putting words on a clear piece of acetate and overlaying it on top of a piece of paper. If I recall, we had issues trying to do this with fpdf and some other PHP PDF libraries, but PDFlib allowed us to do it and it's what we've used ever since. Actually, tedd.. did you use PDFlib or another library or maybe something in PHP5 (that we don't use yet)? We may be moving off of PDFlib at some point and I may be looking for alternatives. This is the main function we need. Ignorant question, but I havn't even thought of researching it yet and figured I'd ask while the topic was at hand. -TG = = = Original message = = = Interesting, that's a good idea. I was not aware that it was possible to load an existing PDF into memory and then add stuff to it. On Dec 27, 2006, at 7:28 AM, tedd wrote: At 6:32 AM -0800 12/27/06, Brian Dunning wrote: Let's say I have a complicated PDF document, like a Christmas card, that was made in Illustrator -- too complicated to easily create from scratch using PDFlib. Is there a way to use PHP make simple text changes - like changing Dear XXX to Dear John? I've opened the files with a text editor and cannot locate the simple text, it appears to be encoded somehow. The PDF has no security or encryption in it. Thanks Brian: I'm not saying that there is/isn't a way to do this, but I tried and failed. In my investigation, I found that the insides of a PDF file are not conducive to a simple search and replace mechanism. The text is encoded in some fashion that is not easy to decode and reassemble. The solution I came up with was to combine the existing PDF file with my coding and write over (on top of) the old to produce the new PDF that I wanted. In your case, take your Christmas Card with a big space where xxx appears and then write over that space with John in your new code. I wish someone would show me a simpler way to do this. hth's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP podcasts
Hey all, I'm doing some maintenance work on a site that features podcasts and some of them work and some of them don't. I've never worked with podcasts before, and while I'm figuring out how they work I was wondering if anyone knew of any good tutorial sites on them and perhaps even programming them in PHP. I've done some Googling but haven't found anything really good. -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP podcasts
Skip Evans wrote: I'm doing some maintenance work on a site that features podcasts and some of them work and some of them don't. I've never worked with podcasts before, and while I'm figuring out how they work I was wondering if anyone knew of any good tutorial sites on them and perhaps even programming them in PHP. I've done some Googling but haven't found anything really good. Programming podcasts makes no sense. A podcast is a media file that is made available for download. I assume that when you say 'programming them in PHP' you mean developing a site to publicise your podcast. Given that assumption your easiest route is to find a blogging package that supports podcasts. There's a list that will get you started here... http://www.podcastingnews.com/topics/Podcasting_Software.html If you're wanting to do something more custom you first need to understand that there is nothing particularly special about podcasts. They are literally just files that are published on a website. I Googled for info on publishing a podcast and came up with dozens of good tutorials and references. Try harder. If I've misunderstood what you're trying to do, please elaborate. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP podcasts
The site plays the podcasts with a code snippet like this: object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0; width=410 height=100 id=movie align= param name=movie value=audioqueue-mini.swf?urls=?php echo $urls ?titles=?php echo $titles ?delim=?php echo $delim ??php echo (isset($skip)) ? skip=$skip : '' ? embed src=audioqueue-mini.swf?urls=?php echo $urls ?titles=?php echo $titles ?delim=?php echo $delim ? quality=high width=410 height=100 name=movie align= type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer; /object Where the $urls variable is a string of URLs. The ones that work all end in .mp3 + some delimiter + another URL that ends in .mp3, etc, etc. However, some show up with no such extension, and in fact no extension of any kind and these don't work. So I suspect that the original programmers code is somehow building URLs that do not in fact connect to the podcast files and that is the main problem. However, having not worked with podcasts before I wasn't absolutely sure this was the problem. The URLs are all supposed to come from the live feeds so I am a bit baffled why some work and some don't. Skip Stut wrote: Skip Evans wrote: I'm doing some maintenance work on a site that features podcasts and some of them work and some of them don't. I've never worked with podcasts before, and while I'm figuring out how they work I was wondering if anyone knew of any good tutorial sites on them and perhaps even programming them in PHP. I've done some Googling but haven't found anything really good. Programming podcasts makes no sense. A podcast is a media file that is made available for download. I assume that when you say 'programming them in PHP' you mean developing a site to publicise your podcast. Given that assumption your easiest route is to find a blogging package that supports podcasts. There's a list that will get you started here... http://www.podcastingnews.com/topics/Podcasting_Software.html If you're wanting to do something more custom you first need to understand that there is nothing particularly special about podcasts. They are literally just files that are published on a website. I Googled for info on publishing a podcast and came up with dozens of good tutorials and references. Try harder. If I've misunderstood what you're trying to do, please elaborate. -Stut -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP podcasts
Yes, Brian, this is all very helpful! Thanks very much! Skip Brian Dunning wrote: Hi Skip - Best is the iTunes Podcast docs: http://www.apple.com/itunes/store/podcaststechspecs.html Use RSS Validator to figure out exactly what's wrong with the ones you have that aren't working: http://feedvalidator.org/ You can take a look at mine for an example. Note that I am using all of the iTunes extensions, which any serious podcaster should do: http://skeptoid.com/podcast.xml In my case I have all the episodes in MySQL and PHP just retrieves them in order and outputs them, formatting according to the RSS spec. Hope this helps... :) On Dec 27, 2006, at 2:46 PM, Skip Evans wrote: Hey all, I'm doing some maintenance work on a site that features podcasts and some of them work and some of them don't. I've never worked with podcasts before, and while I'm figuring out how they work I was wondering if anyone knew of any good tutorial sites on them and perhaps even programming them in PHP. I've done some Googling but haven't found anything really good. -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP podcasts
Skip Evans wrote: The URLs are all supposed to come from the live feeds so I am a bit baffled why some work and some don't. Are you sure that all the URLs in the feeds are still working? Remember that links go bad. Beyond that it's difficult to help with this specific problem without seeing some code and the XML feeds that the code is using. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php