in reply to HTML and SVG to PDF

I'm aware you say you "can't use any external application". However, you may actually be able to do so. (Disclaimer: you don't really give a reason why this won't work, so I'm going to assume it can.)

First off, a brief point about the mentality of unix, where perl derives much of its design from. That is, do one thing and do it well. There are programs out there that do pdf conversions, do that well, and that's all they do. There is significant advantage to using them: they work, they're efficient, and you don't need to debug them.

Next. No one says that you need to create an HTML file and tell the user to call html2ps. Or to create an XML file and tell the user to call fop. You can create the HTML or XML files, and call html2ps or fop yourself. Automatically. With no user intervention. Yes, you'll have an external dependancy. But the output of your program is still a simple PDF. You can concentrate, then, on aspects of your application that are directed towards content without worrying about how to embed SVG into PDF or anything silly like that. Let the converters deal with those details. Do your job, do it well, and leave parts that aren't relevant to your problem to others.

You'll save a lot of time that way. ;-) You may incorporate those other programs into your solution, but they aren't really part of the problem you're solving, which is to get information to the proper users. Concentrate on that. :-)

Replies are listed 'Best First'.
Re^2: HTML and SVG to PDF
by josera (Beadle) on Aug 02, 2005 at 14:48 UTC
    Hello, Thank you for your idea, i think the same that you, if something is done and it works good, why should you do again? Securely you'll do something worse. The problem is that my computer only has installed Windows, i can't run Linux, and i have no permission to install programs, i think that html2ps it's a good alternative, but i have to install the program imagemagick to work it together and i can't because i haven't got enough privileges, so i don't know how can i do that, because the module that i've found to write a PDF are low level, and they are very complicated to use. I hope to find something... Thank you anyway
      The problem is that my computer only has installed Windows, i can't run Linux, and i have no permission to install programs
      Go, ask the admin ;-)

      Seriously, the tools mentioned here don't have to be installed. fop is a java program that can simply be copied to somewhere in the file system you have access to. I don't know for sure, but i think you can simply copy and use the other tools too. (except for imagemagick which comes with a installer iirc.)

      sidenote: is this a task at your workplace? if so, you really should talk to your boss and explain what you need, so he/she can tell the sysadmins to install that.


      holli, /regexed monk/
      and i have no permission to install programs, ...

      Here's a memorable line from Zaxo, in reply to a poster with a similar problem

      . . . without using any module.
      Who is handicapping you in this way? Do they have any stake in the result?

      hth