Koozali.org: home of the SME Server

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

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #15 on: September 16, 2010, 09:03:02 PM »
I need to be able to convert  the HTML files I am serving to PDF files

please explain the problem.. do you have some php pages? do you need to obtain pdf from static html pages?

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 #16 on: September 17, 2010, 12:48:46 AM »
Yes, Stefano, I need to obtain PDF files from static HTML pages.  And I need to do it from a script so that I may bulk process batches of HTML files from the command line.

Offline janet

  • *****
  • 4,812
  • +0/-0
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #18 on: September 19, 2010, 02:20:52 AM »
Moved to General Discussion.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Installation problems
« Reply #19 on: September 20, 2010, 11:19:51 PM »
OK, I followed the instructions at this link:

http://forums.contribs.org/index.php/topic,40484.html

I used these instructions,

Code: [Select]
mkdir -p cups_rpms
cd cups_rpms/
wget ftp://smeserver.hkisl.net/smeserver/contribs/rvandenaker/testing/smeserver-cups/repositories/7.0/RPMS/i386/*
wget ftp://smeserver.hkisl.net/smeserver/contribs/rvandenaker/testing/smeserver-cups/repositories/7.0/RPMS/noarch/*
yum localinstall *.rpm

Although, the RPMs did not all install to the cups_rpms directory.  They installed to another directory which wget showed in the output.  I moved all the files together back into the single cups_rpms and did the "yum localintall *.rpm".  I also had some difficultry tracking down a live download link.

But, it would not install.  I am getting missing dependency errors.  If anyone would like to see what they were, tell me how to collect the information and I will post it.  The above instructions were applied after removing the LPRng software as instructed at the original link that links to the correction applying the localinstall.

Does anyone have any ideas to try next?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Installation problems
« Reply #20 on: September 21, 2010, 02:06:10 AM »
LANMonkey

To check you have downloaded ALL the rpms

cd /cups_rpms
then show the output of
ls -al

To see if each rpm is installed one by one do
rpm -q packagename
eg
rpm -q cups

You can add all the packagenames in the rvandenaker contrib folder on one line
see
http://mirror.contribs.org/contribs/rvandenaker/testing/smeserver-cups/repositories/7.0/RPMS/i386
and
http://mirror.contribs.org/contribs/rvandenaker/testing/smeserver-cups/repositories/7.0/RPMS/noarch
(these will resolve to the fastest available mirror download site)

rpm -q cups ghostscript gimp-print-cups-common pkgname pkgname pkgname etc etc etc
and so on adding all the other package names


As it says in the Wiki article at http://wiki.contribs.org/Cups
manually download all the rpms using a web browser

Then copy them to your sme server, checking that they have all been downloaded
then issue the command
yum localinstall *.rpm


Furthermore you really need to provide the error messages you see when doing the yum install so that we can see what dependency errors you have.
Be realistic, most of us are not mind readers (although some of us may have that talent).

If you are using a Putty ssh window, then right click on the icon in the top left corner and select copy all to clipboard (or similar), then paste that into a message here, and remove any security info from the history.

I just manually download all 16 rpms to my user home folder
then cd'd (changed to that folder) and issued
ls -al
to check all rpms were there
then did
yum localinstall *

which seemed to work except for the one dependency error due to not uninstalling the e-smith-LPRng package first
« Last Edit: September 21, 2010, 02:16:10 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline dgs

  • ***
  • 63
  • +0/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #21 on: September 22, 2010, 01:11:24 AM »
Not sure if this is what the OP is after but have a look at http://www.tufat.com/s_html2ps_html2pdf.htm .

I haven't tried it but I had some success with a PDF form generator http://www.tufat.com/s_pdf_reports_mysql.htm from the same author.

Offline alten

  • 1
  • +0/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #22 on: September 22, 2010, 02:37:02 AM »
Another avenue you could use (after solving the CUPS printing thing) is to print to GIF (or experiment to find a better format) and pipe the output to GRAPHICSMAGICK (http://www.graphicsmagick.org/) which seems to be very efficient. 

Offline Abigail111

  • 1
  • +0/-0
Re: Is there anything in SME to convert HTML to PDF files? CSS support required.
« Reply #23 on: September 17, 2013, 05:03:03 AM »
Hello
 Although i have never try to convert HTML to pdf files in SME.But i often convert image formats to pdf with a pdf convertor.
Here is my method to convert files:
 public void ConvertPdftoHtml(string PDFInputFile, int PDFPageNumber, string HTMLOutputFile);
YOu can have a look.Hope to help you.