|
![]() |
|
| Author |
|
|||||||
|
Pinky
Posts: 1395
Location: Melbourne, Victoria
|
I have a report in SVG format (Inkscape) which I turned into an XSL document (by hand). Now I have some HTML form output that has been saved as XML in PHP. Then also in PHP the XML file is transformed using the XSL document, so now I basically have my pretty SVG form filled with the HTML form data. My question is, how can I turn this baby into a PDF from within PHP? I tried ImageMagick but that was pretty much fail. It worked, but the resulting PDF was crap. Didn't take advantage of the SVG at all - it seems to rasterize the SVG. |
|||||||
| #0 03:07pm 28/04/09 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
trog
AGN Admin
Posts: 26674
Location: Brisbane, Queensland
|
||||||||
| #1 03:15pm 28/04/09 |
|
|||||||
|
Jim
Posts: 9602
Location: Brisbane, Queensland
|
there's also a pdflib-based extension but I've never tried it:
http://au.php.net/manual/en/book.pdf.php user-comments on that page also suggest other libraries |
|||||||
| #2 03:36pm 28/04/09 |
|
|||||||
|
Pinky
Posts: 1396
Location: Melbourne, Victoria
|
That HTMLDOC library is pretty interesting, have bookmarked but not exactly what I'm after. I had a look at that pdf extension, that seems to be similar to what I have been using before: http://www.ros.co.nz/pdf/ To expand more on what I've done it's very similar to this, which I used as a guide: http://www.linuxjournal.com/article/9283 The bit where I'm stuck is at the bottom of that article they pipe Inkscape to lpr - I can't do that because my host doesn't have Inkscape and I can't install it on the server. They do have ImageMagick, but unfortunately that didn't work very well. I was so confident it would *sigh* So I'm trying to look for an alternative to that. I think I might have pulled up short, because I have been searching for a solution for an hour. Time to move on I think. |
|||||||
| #3 03:50pm 28/04/09 |
|
|||||||
|
$ack
Posts: 463
Location: Brisbane, Queensland
|
Paging Cerb
|
|||||||
| #4 04:39pm 28/04/09 |
|
|||||||
|
Jim
Posts: 9603
Location: Brisbane, Queensland
|
I read your first post as asking how to output something you have in php, to pdf from php, based on:
My question is, how can I turn this baby into a PDF from within PHP? is that not the case? |
|||||||
| #5 04:57pm 28/04/09 |
|
|||||||
|
Pinky
Posts: 1398
Location: Melbourne, Victoria
|
My bad, it's not very clear. This should be one sentence: so now I basically have my pretty SVG form filled with the HTML form data. What it means in proper English is that I have an SVG file, and I need to conver it to a proper PDF file (without rasterizing like ImageMagick) |
|||||||
| #6 08:39pm 28/04/09 |
|
|||||||
|
jesu
Posts: 589
Location: Brisbane, Queensland
|
||||||||
| #7 05:37pm 29/04/09 |
|
|||||||
|
Pinky
Posts: 1405
Location: Melbourne, Victoria
|
That, my good sir, is a great lib. Bookmarked. Still didn't solve my prob though - I think I'm just going to have to get over that I can't produce pretty PDFs directly from my web-app yet. |
|||||||
| #8 06:12pm 29/04/09 |
|
|||||||
|
Jim
Posts: 9615
Location: Brisbane, Queensland
|
I've never worked with an SVG personally so can't offer anything off the top of my head
If I need a break from l4d I might have a crack at it later |
|||||||
| #9 09:00pm 29/04/09 |
|
|||||||
|
simul
Posts: 505
Location: Brisbane, Queensland
|
Easiest way will probably be to convert the svg to swf, and then convert the swf to pdf via some form. I haven't tried it myself, but a decent svg > swf should keep all the vector information correctly, and same with swf > pdf.
|
|||||||
| #10 07:51am 30/04/09 |
|
|||||||
|
Pinky
Posts: 1414
Location: Melbourne, Victoria
|
Hot tip simul, worth a shot. Will let you know if any success. |
|||||||
| #11 03:16pm 30/04/09 |
|
|||||||
|
Farseeker
Posts: 1528
Location: Brisbane, Queensland
|
http://www.princexml.com/doc/6.0/php/ looks worth a try - they have an svg to pdf example in their samples.
|
|||||||
| #12 08:29am 01/05/09 |
|
|||||||
|
Pinky
Posts: 1420
Location: Melbourne, Victoria
|
Sweet Mother of Lord, Farseeker. Awesome lib!! |
|||||||
| #13 10:30am 01/05/09 |
|
|||||||
|
system
|
--
|
|||||||
| #13 |
|
|||||||
|
| ||||||||