Home › Forums › TWAIN Mac/OSX › Imported image ends with vertically flipped
- This topic has 2 replies, 3 voices, and was last updated 8 years, 5 months ago by JonyGreen.
- AuthorPosts
We are working on scanner DS. To import the PDF images we are converting the PDF image to BMP. For this we were using QuickTime APIs.
But we had a problem where in for multiple PDF pages, the QuickTime APIs are failing to convert to BMP for the pages other than first page. i.e we are not able to convert PDF pages other than the first page.
Below given is code snippet:
GetGraphicsImporterForFileWithFlags(&importedFile,&gi,kDontUseValidateToFindGraphicsImporter);err = GraphicsImportGetImageCount(gi, &nPages);
Even for multiple page PDF the API ‘GraphicsImportGetImageCount’ returns just 1 and we cannot convert other than first page to BMP.To solve this we are now using ‘ImageIO’ framework APIs.
Here we are able to convert the PDF pages to BMP.Below given is code snippet:
imageDestRef = CGImageDestinationCreateWithData(imageData, (CFStringRef)@”com.microsoft.bmp”, 1, NULL);
CGImageDestinationAddImage(imageDestRef, outImage,(CFMutableDictionaryRef)metadata);
Above method converts the PDF to BMP even for multiple PDF as expected.But we are having a strange problem here, after importing the BMP (to Microsoft word or any other App) in this case, the image imported to application gets vertically flipped.
My question is:
1. Is there any alternative in Quicktime APIs so that no need to switch to ‘ImageIO’ framework?
2. Or in ‘ImageIO’ case why the resultant imported image gets vertically flipped. What is the solution for this.Thanks in advance.
Regards
Lokesh
________
Mercedes-Benz Gl-ClassHi, Lokesha.
As for myself, I have seldom tried to convert PDF image to BMP using QuickTime APIs. I wonder have you ever worked it out? Do I need another 3rd party manual toolkit? When it comes PDF converting process, I have another question, I wonder have you ever tried to convert pdf to other image files before? As for myself, I am testing the related PDF to PNG converting, PDF to BMP converting , and PDF to JPG converting programs these days. Do you have experience about it? Any suggestion will be appreciated. Thanks in advance.Best regards,
Peter
As you know, pdf to image like bmp, jpeg, png is easy with your code, only need change the saving format in Image class. however, i want to convert pdf to word document, can you provide some suggestion? or converting pdf to text is ok, then i can create the word with these test by calling the office api.
- AuthorPosts