comp.lang.ada
 help / color / mirror / Atom feed
* PDF to JPEG
@ 2011-03-18  9:18 Hoàng Đình Long
  2011-03-21 10:01 ` Gautier write-only
  0 siblings, 1 reply; 12+ messages in thread
From: Hoàng Đình Long @ 2011-03-18  9:18 UTC (permalink / raw)


Hello!

I need free libraries which help to convert PDF to images (jpeg, png,
tiff ...etc...). I need good document, examples, and tutorial (if
there is one).

Thanks in advance!



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-18  9:18 PDF to JPEG Hoàng Đình Long
@ 2011-03-21 10:01 ` Gautier write-only
  2011-03-21 14:57   ` Hoàng Đình Long
  2011-03-21 14:58   ` Hoàng Đình Long
  0 siblings, 2 replies; 12+ messages in thread
From: Gautier write-only @ 2011-03-21 10:01 UTC (permalink / raw)


On Mar 18, 10:18 am, Hoàng Đình Long wrote:

> I need free libraries which help to convert PDF to images (jpeg, png,
> tiff ...etc...). I need good document, examples, and tutorial (if
> there is one).

Not sure if you want to output the pages of a PDF to bitmaps (instead
of, say, to a printer), or extract the images that are in the PDF. For
the first it would be perhaps better to have an interaction with
Acrobat Reader, for the second, you need to parse the PDF file.
HTHAB
______________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/
NB: follow the above link for a valid e-mail address



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 10:01 ` Gautier write-only
@ 2011-03-21 14:57   ` Hoàng Đình Long
  2011-03-21 16:28     ` J-P. Rosen
  2011-03-22 11:12     ` robin
  2011-03-21 14:58   ` Hoàng Đình Long
  1 sibling, 2 replies; 12+ messages in thread
From: Hoàng Đình Long @ 2011-03-21 14:57 UTC (permalink / raw)


On Mar 21, 5:01 pm, Gautier write-only <gautier_niou...@hotmail.com>
wrote:
> On Mar 18, 10:18 am, Hoàng Đình Long wrote:
>
> > I need free libraries which help to convert PDF to images (jpeg, png,
> > tiff ...etc...). I need good document, examples, and tutorial (if
> > there is one).
>
> Not sure if you want to output the pages of a PDF to bitmaps (instead
> of, say, to a printer), or extract the images that are in the PDF. For
> the first it would be perhaps better to have an interaction with
> Acrobat Reader, for the second, you need to parse the PDF file.
> HTHAB
> ______________________________________________________________
> Gautier's Ada programming --http://gautiersblog.blogspot.com/
> NB: follow the above link for a valid e-mail address

In fact, I can do it in Java. I choose Ada because I have learnt it
recently ( I am not proficient yet). I want to have some case studies,
just for fun. Because my friend is a designer and she needs to convert
pdf to jpeg, that's why I think I can do it in Ada if there are some
libraries out there (get some practices).



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 10:01 ` Gautier write-only
  2011-03-21 14:57   ` Hoàng Đình Long
@ 2011-03-21 14:58   ` Hoàng Đình Long
  2011-03-21 20:23     ` Yannick Duchêne (Hibou57)
  2011-03-21 23:47     ` Gautier write-only
  1 sibling, 2 replies; 12+ messages in thread
From: Hoàng Đình Long @ 2011-03-21 14:58 UTC (permalink / raw)


Yes! I must parse the file. That's the problem.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 14:57   ` Hoàng Đình Long
@ 2011-03-21 16:28     ` J-P. Rosen
  2011-03-21 16:58       ` Georg Bauhaus
  2011-03-22 11:12     ` robin
  1 sibling, 1 reply; 12+ messages in thread
From: J-P. Rosen @ 2011-03-21 16:28 UTC (permalink / raw)


Le 21/03/2011 15:57, Hoàng Đình Long a écrit :
> In fact, I can do it in Java. I choose Ada because I have learnt it
> recently ( I am not proficient yet). I want to have some case studies,
> just for fun. Because my friend is a designer and she needs to convert
> pdf to jpeg, that's why I think I can do it in Ada if there are some
> libraries out there (get some practices).
If you just want to convert image formats, you don't need any
programming (in any language). Just use Convert (from ImageMagik) on
Linux, or Irfanview on Windows...

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a déménagé / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 16:28     ` J-P. Rosen
@ 2011-03-21 16:58       ` Georg Bauhaus
  0 siblings, 0 replies; 12+ messages in thread
From: Georg Bauhaus @ 2011-03-21 16:58 UTC (permalink / raw)


On 3/21/11 5:28 PM, J-P. Rosen wrote:
> Le 21/03/2011 15:57, Hoàng Đình Long a écrit :

> If you just want to convert image formats, you don't need any
> programming (in any language). Just use Convert (from ImageMagik) on
> Linux, or Irfanview on Windows...
>
Or, for the PDF files, running Ghostscript with the desired
output device  should do.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 14:58   ` Hoàng Đình Long
@ 2011-03-21 20:23     ` Yannick Duchêne (Hibou57)
  2011-03-21 23:47     ` Gautier write-only
  1 sibling, 0 replies; 12+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-03-21 20:23 UTC (permalink / raw)


Le Mon, 21 Mar 2011 15:58:45 +0100, Hoàng Đình Long <long.hdi@gmail.com> a  
écrit:

> Yes! I must parse the file. That's the problem.
This should be feasible using GhostScript as some suggested above. You may  
invok it as an external process, using command line parameters and  
interpreting its output, or you may bind and use the GhostScript API. I  
know you are new to Ada, so the external process way should be recommended  
(no need for you to look at binding now in the first place).

A link with some example of using GhostScript API :
http://pages.cs.wisc.edu/~ghost/doc/gsapi.htm
There are some with Delphi, which is close enough to Pascal, which is  
close enough to Ada (lol)

Do you feel this could be OK ?

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 14:58   ` Hoàng Đình Long
  2011-03-21 20:23     ` Yannick Duchêne (Hibou57)
@ 2011-03-21 23:47     ` Gautier write-only
  2011-03-22  3:09       ` Hoàng Đình Long
  1 sibling, 1 reply; 12+ messages in thread
From: Gautier write-only @ 2011-03-21 23:47 UTC (permalink / raw)


On Mar 21, 3:58 pm, Hoàng Đình Long wrote:
> Yes! I must parse the file. That's the problem.

The PDF format seems to be a mixture of text (including main tokens)
and binary.
When Googl'ing "PDF parser" I come across a parser in Python which is
fairly readable:

http://blog.didierstevens.com/programs/pdf-tools/

Typically I'd take it as a basis if I wanted to make an Ada version.
NB: for the LZW and Deflate decoders, there is already an Ada
implementation in Zip-Ada.
No need to translate...
Have fun

Gautier



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 23:47     ` Gautier write-only
@ 2011-03-22  3:09       ` Hoàng Đình Long
  2011-03-22 11:15         ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 12+ messages in thread
From: Hoàng Đình Long @ 2011-03-22  3:09 UTC (permalink / raw)


ok, not quite as I expected (what I expected was a pure Ada library
(like some in AdaColl)) but now it turns into Ghostscript, lol). The
Python version is complicated enough with too much details.

Anyway, thanks for all suggestions.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-21 14:57   ` Hoàng Đình Long
  2011-03-21 16:28     ` J-P. Rosen
@ 2011-03-22 11:12     ` robin
  1 sibling, 0 replies; 12+ messages in thread
From: robin @ 2011-03-22 11:12 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Hoàng Ðình Long wrote in message
<9492021c-665d-43cb-8368-1e2d72e4f210@z27g2000prz.googlegroups.com>...

>In fact, I can do it in Java. I choose Ada because I have learnt it
>recently ( I am not proficient yet). I want to have some case studies,
>just for fun. Because my friend is a designer and she needs to convert
>pdf to jpeg, that's why I think I can do it in Ada if there are some
>libraries out there (get some practices).

You can always press PRINT SCRN,
and paste the image into a picture program.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-22  3:09       ` Hoàng Đình Long
@ 2011-03-22 11:15         ` Yannick Duchêne (Hibou57)
  2011-03-22 14:53           ` Hoàng Đình Long
  0 siblings, 1 reply; 12+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-03-22 11:15 UTC (permalink / raw)


Le Tue, 22 Mar 2011 04:09:55 +0100, Hoàng Đình Long <long.hdi@gmail.com> a  
écrit:

> ok, not quite as I expected (what I expected was a pure Ada library
> (like some in AdaColl)) but now it turns into Ghostscript, lol).

There is no trouble to rely on an external application to achieve a task,  
that's good design too (unless you want to to run in environment which  
does not provide any of this kind of service). Now, if you just wanted  
some exercising in Ada, then this particular topic of working with PDF,  
may not be the best one to choose.

Note: if you need help about running external programs from Ada, just ask  
for it


-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: PDF to JPEG
  2011-03-22 11:15         ` Yannick Duchêne (Hibou57)
@ 2011-03-22 14:53           ` Hoàng Đình Long
  0 siblings, 0 replies; 12+ messages in thread
From: Hoàng Đình Long @ 2011-03-22 14:53 UTC (permalink / raw)


My final decision is to quit and choose another topic as a case study.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-03-22 14:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-18  9:18 PDF to JPEG Hoàng Đình Long
2011-03-21 10:01 ` Gautier write-only
2011-03-21 14:57   ` Hoàng Đình Long
2011-03-21 16:28     ` J-P. Rosen
2011-03-21 16:58       ` Georg Bauhaus
2011-03-22 11:12     ` robin
2011-03-21 14:58   ` Hoàng Đình Long
2011-03-21 20:23     ` Yannick Duchêne (Hibou57)
2011-03-21 23:47     ` Gautier write-only
2011-03-22  3:09       ` Hoàng Đình Long
2011-03-22 11:15         ` Yannick Duchêne (Hibou57)
2011-03-22 14:53           ` Hoàng Đình Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox