GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   developers how do you print source code on the fly? (https://gfy.com/showthread.php?t=1005134)

fris 01-07-2011 08:57 PM

developers how do you print source code on the fly?
 
i want users to be able to download snippets of source code in pdf format.

anyone know a trick around getting to send it to pdf format using a php class of some sort?

currently im using dompdf.

:thumbsup

edgeprod 01-07-2011 09:31 PM

Obviously, the code is being read dynamically, and there's nothing you've found in Pear? During my time on the Python team, I remember some py lib that'd output to PDF. As a last resort, you could probably convert it from the command line.

edgeprod 01-07-2011 09:33 PM

And did you try fpdf.org unsuccessfully already?

Kiopa_Matt 01-07-2011 10:01 PM

Quote:

Originally Posted by edgeprod (Post 17828452)
And did you try fpdf.org unsuccessfully already?

That's what I always use, and it's a good little library. PDF is a pain though, because everything has to go pixel by pixel. If you're dynamically generating some statement or invoice, you end up fucking around reloading the PDF a few times a minute just to move a line or piece of text over by a couple pixels here and there, to make sure everything lines up.

It's a pain...

TheDoc 01-08-2011 04:45 AM

I just bookmarked this a few days back...haven't used it yet.

http://www.pdflib.com/products/pdflib-family/pdflib/

"PDFlib’s main targets are dynamic PDF creation on a Web server"

fris 01-08-2011 07:04 AM

Quote:

Originally Posted by TheDoc (Post 17828673)
I just bookmarked this a few days back...haven't used it yet.

http://www.pdflib.com/products/pdflib-family/pdflib/

"PDFlib?s main targets are dynamic PDF creation on a Web server"

ya dompdf uses pdflib, just dont know how to make it highlight the source code when creating the actual pdf, it tries to run the actual php code, and ive tried highlight_file, even set the output to false, but still no go.

:mad:

TheDoc 01-08-2011 07:35 AM

Quote:

Originally Posted by fris (Post 17828789)
ya dompdf uses pdflib, just dont know how to make it highlight the source code when creating the actual pdf, it tries to run the actual php code, and ive tried highlight_file, even set the output to false, but still no go.

:mad:

Not sure how you get the content, but can you remove/filter the php tags?

edgeprod 01-10-2011 02:00 AM

Get everything sorted, fris? Feel free to ICQ or call if you need a hand.


All times are GMT -7. The time now is 02:51 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123