944,126 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 16675
  • PHP RSS
Sep 8th, 2004
0

download pdf file, convert to html, in PHP since working in Linux

Expand Post »
Dear Friends,,
i want to download a pdf file from any server since i have url of a pdf file then i convert it in html format. i am working in PHP and enviorment is linux.

Pleas help me for this script i am much upset due to this


With Best Regards
Qadeer Minhas
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
qadeer is offline Offline
2 posts
since Sep 2004
Oct 10th, 2004
0

Re: download pdf file, convert to html, in PHP since working in Linux

Hello qadeer,

try to use the commands shell
$ pdftotext <file.pdf> <file.text>
this program come with the package xpdf.

or try directly:
$ convert <file.pdf> <file.html>
when I do the test the program convert in various html files with one gif file

see you,

fpepito


Quote originally posted by qadeer ...
Dear Friends,,
i want to download a pdf file from any server since i have url of a pdf file then i convert it in html format. i am working in PHP and enviorment is linux.

Pleas help me for this script i am much upset due to this


With Best Regards
Qadeer Minhas
Reputation Points: 10
Solved Threads: 1
Newbie Poster
fpepito is offline Offline
14 posts
since Oct 2004
Sep 3rd, 2007
0

Re: download pdf file, convert to html, in PHP since working in Linux

If you want something windows based I think you can take the HTML to PDF converter library for .NET from http://www.dotnet-reporting.com or from http://www.winnovative-software.com. You can be build your own application or you can use the demo one.

All the conversion can be done in a few lines for C# code:


// Create the PDF converter. Optionally you can specify the virtual browser
// width as parameter. 1024 pixels is default, 0 means autodetect
PdfConverter pdfConverter = new PdfConverter();
// set the license key
pdfConverter.LicenseKey = "P38cBx6AWW7b9c81TjEGxnrazP+J7rOjs+9omJ3TUycauK+cLWdrITM5T59hdW5r";
// set the converter options
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
pdfConverter.PdfDocumentOptions.ShowHeader = false;
pdfConverter.PdfDocumentOptions.ShowFooter = false;
// set to generate selectable pdf or a pdf with embedded image
pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = selectablePDF;

// Performs the conversion and get the pdf document bytes that you can further
// save to a file or send as a browser response
byte[] pdfBytes = pdfConverter.GetPdfFromUrlBytes(urlToConvert);
Reputation Points: 16
Solved Threads: 0
Newbie Poster
fchivu is offline Offline
3 posts
since Aug 2007
Sep 4th, 2007
0

Re: download pdf file, convert to html, in PHP since working in Linux

Here is a class used to convert HTML to PDF, but I'm not sure about the reverse:

http://www.phpclasses.org/browse/package/2905.html
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Usayd is offline Offline
2 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC