Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, February 3, 2009 10:59:22 PM(UTC)


Groups: Registered
Posts: 3


Long story short i realized that the miltipage pdf documents i was OCR:ing all contained only the first page, repeated as every page. It narrowed down to being the rastercodecs.load that seemingly loads the first page as every page.

            Dim rcc As New RasterCodecs
            rcc.Options.Load.XResolution = 300
            rcc.Options.Load.YResolution = 300
            rcc.Options.Load.Format = RasterImageFormat.Tif

            Dim image As RasterImage = rcc.Load("c:\test.pdf", 16, Codecs.CodecsLoadByteOrder.Bgr, 1, -1)

            rcc.Save(image, New Uri("c:\test.gif"), RasterImageFormat.Gif, 8, 2, 2)

This code produce a saved gif of the first page, regardless of what i put as the last and first page in the save. It should be noted that the page count is always correct - that is if i load from page 2 to 3 i get a 2 page rasterimage, but those two pages are actually the first page. Any thoughts on this. Should i use another method of loading files? My load is ment to handle tiff, pdf and jpg, and it does, except when it comes to multipages. The rasteimage is then passed on to an IOcrDocument

Thanks for any help and a great product!


Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, February 3, 2009 11:00:31 PM(UTC)


Groups: Registered
Posts: 3

sorry, running eval 16 dot net
#3 Posted : Wednesday, February 4, 2009 7:01:29 AM(UTC)

Adnan Ismail  

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

If you want to save a multiple pages PDF file into GIF file with all pages, please try the following code on the attached PDF file:
Dim codecs As RasterCodecs = New RasterCodecs()
Dim img As RasterImage = codecs.Load("d:\license_sdk16.pdf", 24, CodecsLoadByteOrder.Rgb, 1, 4)
codecs.Save(img, "d:\test.gif", RasterImageFormat.Gif, 8, 1, 4, 1, CodecsSavePageMode.Append)
The result should be the same as the GIF image. Do you get the same result? If this is not what you want, please send me more details about your requirements.
File Attachment(s):
test.zip (1,756kb) downloaded 20 time(s).
#4 Posted : Thursday, February 5, 2009 2:13:38 AM(UTC)


Groups: Registered
Posts: 3

Thanks for the help! The problem is now solved

For the record, heres how it was solved:
- Loading the Pdf as Tif format produced the first page as every page in the rasterimage. As described page 1, 2, 3, 4, 5 would load as a rasterimage with page 1, 1, 1, 1, 1
- When removed (as suggested) i got a pdf-component error, solved by a reinstall.
- The OCR autozoning then complained at the low load resolution of the Pdf (72dpi as default), this was solved by setting
        RasterCodecs.Options.Pdf.Load.XResolution = 300
        RasterCodecs.Options.Pdf.Load.YResolution = 300

thanks again
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.596 seconds.