Code Print

Does anyone know how to get multiple code files to a single PDF?

What I’m hopping for is to be able to save a bunch of different code files (PIC C), where a new file begins a new page, and preferably with syntax coloring. Help?

I don’t know much about it, but I know this would be possible with PHP. That would be look too, because then it could be something available to everyone if you want it to be. :slight_smile:

It would be pretty easy in PHP thanks to PDFlib functions.

Well, do you have just the Acrobat reader program? Assuming this is the case … you might try PDF::Create, a perl module. This way you could loop over all the files you wanted and harness perl’s text processing ability to add syntax highlighting yourself (if desired). Also, OO.o will export to PDF.

I’ll try that. I don’t actually know pearl, but my dad does, so I’ll ask him.

I do have PDFwriter (Adobe’s PDF print driver), but the problem is that I can’t find an editor that will print several files at once.

So far, the best solution I have found is to print them one at a time, open the results, copy them into Word, respace it, and then print it out again. Quite labor intensive. I tried to find an HTML type printer, but no luck (HTML would be easy to append).

Why do you print them to PDFwriter first? To save the color coding? There are dozens of text editors with syntax highlighting. I’m sure some of them will let you copy with color in tact. There is a thread listing a dozen or so (I think you posted in it, so I’m sure you know).

I’d still do it in PHP (or Perl). If you do it in PHP, use SilverStar’s C highlighter at