TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Imported image ends with vertically flipped

Forums › TWAIN Mac/OSX › Imported image ends with vertically flipped

  • This topic has 2 replies, 3 voices, and was last updated 5 years, 3 months ago by JonyGreen.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 13, 2009 at 9:47 am #22452 Reply
    lokesha
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    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-Class

    October 10, 2015 at 8:56 am #24775 Reply
    peterlee
    Participant
    • Topics - 0
    • Replies - 24
    • Total Posts - 24

    Hi, 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

    November 10, 2015 at 12:29 pm #24776 Reply
    JonyGreen
    Participant
    • Topics - 0
    • Replies - 2
    • Total Posts - 2

    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.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Imported image ends with vertically flipped
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • could not open the twain source. Make sure there is a valid source for your sca
  • Changing TWAIN driver defaults
  • Scanner starts transfer when console gets closed (CITRIX)
  • Kodak RFS 3600
  • Didn’t save enough file scan
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.