Dominic Lachowicz wrote:
>
>> I think that abiword --to-png or --thumb does not work from command line
>> because it need a DISPLAY device. When I set Xvfb as a default display
>> device, abiword --to-png started behaving differently, instead of giving
>> some error it now just hangs.
>>
>> I wonder if anyone was able to create document preview pngs with abiword
>> on a server that does not have a display?
>
>
> --to-png is no longer supported in AbiWord 2.5. It never did what
> people thought it would anyway. It would convert any image format to
> PNG on the command-line. It would not convert a document to a PNG.
> Basically, it was a *really really* dumb version of ImageMagick's
> convert program.
>
> In AbiWord 2.5, you don't need a display to convert a document to PS
> or PDF (or any other format). From there, you can use ghostscript,
> ImageMagick, or poppler to produce a preview image of the document.
> I'd suggest writing a small program using Poppler's C API that does
> exactly that. It would:
>
> 1) Use AbiWord to convert the document to PDF
> 2) Use poppler + a cairo image surface to load and render the first
> page of that PDF
> 3) Save that cairo image surface to a PNG on disk
>
> Should be < 50 lines of C code.
>
> Best,
> Dom
If I covert the document to pdf first, then I think there is a chance
that a layout or some formatting will change and will not look exactly
the same as original.
I just thought of another idea I want to try - what if I open document
in abiword, using Xvfb, then capture that Xvfb screen (like redirect it
to stdout), then use netbmp tools like pnmscale and pnmtojpeg to
generate an image of that screenshot.
I think it may work, I'll try it.
-----------------------------------------------
To unsubscribe from this list, send a message to
abiword-user-request@abisource.com with the word
unsubscribe in the message body.
Received on Fri Mar 23 20:28:51 2007
This archive was generated by hypermail 2.1.8 : Fri Mar 23 2007 - 20:28:51 CET