Koozali.org: home of the SME Server

Is there anything in SME to convert HTML to PDF files? CSS support required.

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
I need to be able to convert  the HTML files I am serving to PDF files.  Is there anything in SME or available to it to convert HTML to PDF files?  I've seen the perl module, but that does not support CSS.

I did a little searching here at the forum and found this clue:

http://forums.contribs.org/index.php/topic,22505.msg89350.html#msg89350

If this is my solution, could anyone summerize how I might apply it?  I am brand new to creating PDF files, but I think I understand that it is somehow related to printing.

I looked through the contribs and couldn't see anything that looked like what I need.

Any and all tips or clues would be appreciated.


Offline Stefano

  • *
  • 10,894
  • +3/-0
hi

take a look here: http://mpdf.bpm1.com/
HTH

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Looks good.  Give me 24 hours or so to check it out.

Anyone else?

Offline axessit

  • *****
  • 213
  • +0/-0
Not entirely sure what you're trying to do, are you wanting users to 'print' a document (that was generated by some webpage app) and get a pdf, in which case the CUPS print to pdf is definitely the way to go, or are you wanting a webpage app to generate a PDF ?

It might be a bit off the tangent, but Hylafax generates an html email with a PDF attachment, but more importantly, can generate a PDF from an email that is html, if you dig down deep into the Hylafax routines.....

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
I am currently posting PHP pages generated by MySQL to the internet that are reports and I would like to be able to offer them in PDF form.  And there are volumes of other static HTML pages and I need a command line tool to convert these, something I can apply through a script and process these pages automatically.  I would also like to collate them into sets of pages.

I saw some discussion of Hylafax and would prefer a more dedicated technology.  I was hoping for a perl module, but the only ones I saw did not support CSS.

Offline axessit

  • *****
  • 213
  • +0/-0
OK, not tried anything like this before, but just addding an idea you might want to follow up on....

I guess it depends on whether you are printing from internal network or external, that may be an issue, but ghostscript is generally used, so you could perhaps do some research around that.

If you are thinking along the lines of the the cups pdf printer, it would, of course, need to see a print job (which could be from a lp command line - ie generated from a perl script) but from the internal network, and it can be sent to a folder, which can be scanned by your web app.

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
OK, not tried anything like this before, but just addding an idea you might want to follow up on....

I guess it depends on whether you are printing from internal network or external, that may be an issue, but ghostscript is generally used, so you could perhaps do some research around that.

If you are thinking along the lines of the the cups pdf printer, it would, of course, need to see a print job (which could be from a lp command line - ie generated from a perl script) but from the internal network, and it can be sent to a folder, which can be scanned by your web app.

This sounds more like what I am looking for.  And it sounds like maybe it is more of a Linux question rather than an SME question.

It sounds like everything is already in place to pring from SME to a PDF file using lp.  But I've tried fooling around with lp and have had a lot of difficulty.  Would anyone know of any documentation to walk me through the process of printing to a PDF file in Linux?  Would this be any different in SME?  I see very little in the SME documentation on printing.  I do see a queue manager in the contribs,

http://wiki.contribs.org/LPRng_print_queue_monitor

How would I print to a PDF file using lp?

Offline janet

  • *****
  • 4,812
  • +0/-0
LANMonkey

Did you read this Contrib article
http://wiki.contribs.org/Cups

Please search using google
http://www.faqs.org/docs/Linux-HOWTO/Printing-Usage-HOWTO.html
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Yes, thank you.  I searched the forum for "cups-pdf" after finding the subject under google.  There I found the link.

But I was unable to find the link in the usual list of HowTo's, FAQ's and the rest.   Could you show me a page in the SME references that has that link?  That is where I looked first.

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #10 on: September 16, 2010, 07:26:08 PM »
http://wiki.contribs.org/Cups

At the above link, there is a note saying that the require repository is not functioning and offers a source for the RPM.  But, there is no documentation there or at the referencing links as to how to apply the RPM instead of the repository.  How do you do that?  Is there a simple substitution?

Also I need to know how to actually print to a PDF file using this installation and none of the links provided do that either.

Does anyone have this information?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #11 on: September 16, 2010, 07:59:08 PM »
LANMonkey

Quote
Could you show me a page in the SME references that has that link?  That is where I looked first.

Please read the last line of my signature which says
Contribs can be found at http://wiki.contribs.org/Category:Contrib

You can also click on the Wiki link at top of forums, & then on right hand side is a link to Contribs.
You need to read all the contribs.org pages more carefully, the Contribs page has been there for years !
« Last Edit: September 16, 2010, 08:04:27 PM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #12 on: September 16, 2010, 08:31:13 PM »
LANMonkey

Quote
there is no documentation there or at the referencing links as to how to apply the RPM instead of the repository.  How do you do that?  Is there a simple substitution?

You need to read all the links referred to. In the CUPS article in the note re the repo not working, it refers to a forum thread re problems with the repo. In that forum thread it also refers to another forum thread on the same topic. In BOTH threads it advises how to install rpms using yum ie
download all the rpms to an empty folder and then cd to that folder and do
yum localinstall *.rpm
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #13 on: September 16, 2010, 08:50:42 PM »
LANMonkey

Quote
I need to know how to actually print to a PDF file using this installation and none of the links provided do that either.

You have a non standard requirement, so you have to be proactive in your
approach. Read again carefully all the links you have been given.
Also do a google search on
print to PDF file from Linux command prompt
and make sure you carefully and slowly read the answers. You are skipping over the information.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #14 on: September 16, 2010, 09:01:12 PM »
LANMonkey

Quote
http://forums.contribs.org/index.php/topic,22505.msg89350.html#msg89350
could anyone summerize how I might apply it?

Referring to your original post, which essentially asks how to configure & use CUPS, install that using the yum localinstall command and follow the current CUPS wiki article carefully. See how you go & whether that fulfills your requirements.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.