LEADTOOLS Support
Document
Document SDK Questions
Re: SaveResultOptions.Format to PDF not working?
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Saturday, August 12, 2006 9:59:18 AM(UTC)
Groups: Registered
Posts: 5
I tried to set:
_rasterOcr.SaveResultOptions.Format = RasterOcrFormatType.Pdf;
But when I open the file with Acrobat Reader, it gives me an error message:
"Adobe Reader could not open 'myFile.pdf' because it is either not a supported file type or because the file has been damaged (...)."
What's wrong? Do I need to set some other property?
Thanks!
#2
Posted
:
Monday, August 14, 2006 6:15:05 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Do you get the problem when using any of our OCR demos to OCR and save as PDF? If not, then please post a small test project that shows it.
Thanks,
#3
Posted
:
Monday, August 14, 2006 8:42:03 AM(UTC)
Groups: Registered
Posts: 5
The demos work fine. This happens only in my application.
Also, when I export to any other format it works. Only PDF gives me this error.
I'll attach the part of my code that saves the result.
Btw, I'm using "LEADTOOLS Document Imaging Suite 14.5" (not the trial)
#4
Posted
:
Tuesday, August 15, 2006 4:52:06 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
That code fragment looks reasonably correct. Can you please post a small test project that I can compile and run?
Thanks,
#5
Posted
:
Tuesday, August 15, 2006 8:55:43 AM(UTC)
Groups: Registered
Posts: 5
Here it is. Also, with the same problem.
I placed a jpg image on the application folder to test the conversion to pdf.
The pdf will be generated in the .exe folder
Thanks
#6
Posted
:
Thursday, August 17, 2006 11:18:59 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You were setting the result options incorrectly. You need to create an instance of RasterOcrResultOptions, fill it up with the options, then set the SaveResultOptions property to this instance. Attached is the modified project.
#7
Posted
:
Friday, August 18, 2006 5:40:40 AM(UTC)
Groups: Registered
Posts: 5
Thank you!
It's working smoothly!
LEADTOOLS Support
Document
Document SDK Questions
Re: SaveResultOptions.Format to PDF not working?
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.