• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Printing multiple images each on a separate page using single NSPrintOperation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Printing multiple images each on a separate page using single NSPrintOperation


  • Subject: Printing multiple images each on a separate page using single NSPrintOperation
  • From: Rahul Kesharwani <email@hidden>
  • Date: Sun, 30 Oct 2011 19:44:11 +0530
  • Acceptlanguage: en-US
  • Thread-topic: Printing multiple images each on a separate page using single NSPrintOperation

Hi

I have a application that intends to print raster image of each page of a document using NSPrintOperation. I am able to create a NSImage of a single page and print it using NSPrintOperation as follows

-void printPage: (NSImage)nsImage
{
        NSImageView *nsImageView = [[NSImageView alloc] init];
        NSSize imageSize = [nsImage size];
        [nsImageView setImage: (NSImage *)nsImage];
        [nsImageView setFrame:NSMakeRect(0, 0, imageSize.width, imageSize.height)];
        [nsImageView setImageScaling:NSScaleToFit];

        NSPrintOperation *mNSPrintOperation = [NSPrintOperation printOperationWithView: (NSView *)nsImageView];

        NSPrintInfo *currentNSPrintInfo = [NSPrintInfo sharedPrintInfo];
        [currentNSPrintInfo setHorizontalPagination:NSFitPagination];
        [currentNSPrintInfo setVerticalPagination:NSFitPagination];

        [mNSPrintOperation setPrintInfo:currentNSPrintInfo];
        [mNSPrintOperation setShowsPrintPanel:NO];
        [mNSPrintOperation setShowsProgressPanel:YES];

        [mNSPrintOperation runOperation];
}

Now when I have multiple pages to print, I would like to print all of them using a single NSPrintOperation. So basically, I would like to insert NSImage/NSImageView of each page as a separate page into a single NSView and use this NSView to print finally using NSPrintOperation. The reason I want to print it using single NSPrintOperation is that I want to get the print progress bar that shows the current page being printed. Otherwise, I could have created a separate NSPrintOperation for each NSImageView and print using it.

Any help would be greatly appreciated

Thanks & Regards
Rahul
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Printing multiple images each on a separate page using single NSPrintOperation
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: Funky errors using MPMoviePlayerViewController
  • Next by Date: Re: Write to file Entitlement
  • Previous by thread: Funky errors using MPMoviePlayerViewController
  • Next by thread: Re: Printing multiple images each on a separate page using single NSPrintOperation
  • Index(es):
    • Date
    • Thread