GDViewer and Pre Image Processing like autodeskew

Discussions about document viewing.
Post Reply
rmbarbosa
Posts: 3
Joined: Fri Feb 25, 2011 5:58 pm

GDViewer and Pre Image Processing like autodeskew

Post by rmbarbosa » Fri Feb 25, 2011 6:10 pm

Hi,
i've trying to figure out the best way to be able to perform an auto-deskew on the current image of the viewer.
My cenario is:
I have a application that opens a document (TIF, PDF, JPG, ... whatever) and each page of that document (if multipage) may need to be "processed" in realtime.
by "processed" i mean i would like to be able to AutoDeskew or remove border or something...
I need to be able to maintain the same funcionality of the GDViewer like VerticalScrolling, Zoom etc...
I don't need to save the changes i just need to aplly an efect to it while i'm viewing it.
It should be similar to the imgViewer.Rotate method ....

I used the viewer method : viwer.DisplayFromStream(docStream) : but i cant get a reference to the current page image. Is there any way?
Then i thought of Creating a GDPictureImage object, deskew it and then send it to the viewer, but the CreateGDPictureImageFromStream fails when the document stream is a PDF.

Do i need to first convert all the pages of the PDF to a GDPictureImage first? if yes then it must be much more slow and performance is a very important issue here.

Can any of you, give-me any sugestions on how to do it?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: GDViewer and Pre Image Processing like autodeskew

Post by Loïc » Mon Feb 28, 2011 10:14 am

Hi,

Please have a look on the image processing sample. You will be able to check a proper way to handle an image for processing purpose, and display it in a viewer object in the same time.

For the PDF issue, you can't handle such document like an image since it is not a raster format. We provide all needed functions to convert PDF pages to bitmap or to extract bitmap in they original format from PDF pages. This should help to convert PDF to multipage tiff for example, then you will be able to handle the multipage tiff for image processing purpose ;)

Kind regards,

Loïc Carrère

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest