You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Daniel Wilson <wi...@gmail.com> on 2009/08/31 19:01:41 UTC

Re: How to use PDFToImage

By command-line I do mean DOS or *Nix prompt.

Others, including at least one of the developers, are using this on a
website.  I'm not sure whether it's PHP, JSP, ASP, or something else that
they're using.

Here are a few links on calling a java class from PHP:

   - http://in.php.net/java
   -
   http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_22038107.html
   The accepted solution on that one involves shelling out to a command prompt
   and calling the java interpreter.  Not very pretty, I'll admit.

If your PHP installation includes MONO, you might use the .Net version of
PDFBox with it.  I'm using the .Net version in production, but with VB.Net
stuff on Windows.  I'm not sure how to call a Mono-installed .Net dll from
PHP.

Again ... one of the other developers may have a good answer here ... I'm
hoping so!

Daniel

On Mon, Aug 31, 2009 at 12:50 PM, Mark W <ex...@gmail.com> wrote:

> I guess my first question is regarding installing PDFBox on the server...Is
> this a typical install where I would need access/rights to install on the
> server? Or by install do you just mean to place the files up there in my
> domain's folders?  I do not/will not have rights to do an actual install,
> register DLLs, etc.
>
> Next, what do mean by command line calls? Command line to me means from a
> DOS prompt - this will be running inside a web page on a site...Sorry for
> all the questions, as I said, real greenhorn here.
>
> Mark
>
>
>
> On Mon, Aug 31, 2009 at 9:17 AM, Daniel Wilson <
> williamstonconsulting@gmail.com> wrote:
>
>> >>So, first, can PDFBox generate the image file via code on my client's
>> site?
>>
>> The PDF is on the server, right?  The PDFBox can be installed on the
>> server
>> and run there to convert the PDF (or any of its pages) to an image.  JPG's
>> and PNG's are certainly available ...
>>
>> >>Second, if possible, how do I do it?
>> Some example code is in
>> src/main/java/org/apache/pdfbox/util/PDFImageWriter.java as well as
>> src/test/org/apache/pdfbox/util/TestPDFToImage.java
>>
>> The former actually compiles to an executable you can call from the
>> command
>> line.
>>
>> Now ... how best do you call Java from PHP?  I don't know ... hoping
>> someone
>> who does will weigh in on that.
>>
>> On Sun, Aug 30, 2009 at 5:17 AM, Mark W <ex...@gmail.com> wrote:
>>
>> > First off, I am a total Java greenhorn...Not even sure PDFBox can do
>> what I
>> > need it to do.
>> >
>> > What I am needing is for a client's web site to be able to create an
>> image
>> > of the first page of a PDF document which I can then use as a thumbnail
>> > link
>> > on their site...I tried already to just ImageMagick but my hosting site
>> > does
>> > not have GhostScript installed, so the PDF libraries are not available
>> to
>> > ImageMagick.
>> >
>> > So, first, can PDFBox generate the image file via code on my client's
>> site?
>> > I don't want my client to have to install or run anything local to their
>> > computer, I want it all to be server side (which of course means I only
>> > have
>> > access to folders within my domain - as far as containing new
>> files/code).
>> >
>> > Second, if possible, how do I do it?  I am really green with Java and am
>> > much more comfortable with PHP and mySQL -- this is new to me but am
>> > willing
>> > to learn but cannot find enough (idiot) level documentation to help me
>> out.
>> >
>> > Thanks in advance.
>> >
>> > Mark
>> >
>>
>
>

Re: How to use PDFToImage

Posted by Ted Dunning <te...@gmail.com>.
We use Thrift extensively for this with really excellent results.  Facebook
is based on this as well.

On Mon, Aug 31, 2009 at 10:01 AM, Daniel Wilson <
williamstonconsulting@gmail.com> wrote:

> Here are a few links on calling a java class from PHP:




-- 
Ted Dunning, CTO
DeepDyve

Re: How to use PDFToImage

Posted by Ted Dunning <te...@gmail.com>.
We use Thrift extensively for this with really excellent results.  Facebook
is based on this as well.

On Mon, Aug 31, 2009 at 10:01 AM, Daniel Wilson <
williamstonconsulting@gmail.com> wrote:

> Here are a few links on calling a java class from PHP:




-- 
Ted Dunning, CTO
DeepDyve