• 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
programatically printing to a postscript file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

programatically printing to a postscript file


  • Subject: programatically printing to a postscript file
  • From: Jae Ho Lee <email@hidden>
  • Date: Mon, 10 Jul 2006 00:57:28 +0900

Hi everyone,

I am writing a simple Cocoa program and I need to programatically
print to a postscript file programatically.

I used below code to print to a pdf file, but I cannot figure out how to
save postscript file.

NSMutableDictionary *pdict = [NSMutableDictionary dictionaryWithDictionary:[[NSPrintInfo sharedPrintInfo] dictionary]];
NSPrinter *printer = [NSPrinter printerWithName:@"myprinter"];
[pdict setObject:@"/tmp/sampe.pdf" forKey:NSPrintSavePath];
NSPrintInfo *pinfo = [[NSPrintInfo alloc] initWithDictionary:pdict];
[pinfo setLeftMargin:0.0];
[pinfo setRightMargin:0.0];
[pinfo setTopMargin:0.0];
[pinfo setBottomMargin:0.0];
[pinfo setPaperSize:[self bounds].size];
[pinfo setJobDisposition:NSPrintSaveJob];
[pinfo setPrinter:printer];
NSPrintOperation *pop = [NSPrintOperation printOperationWithView:self printInfo:pinfo];
[pop setShowsPrintPanel:NO];
if (![pop runOperation]) NSLog(@"printing failed");
[pinfo release];


Is there anyway to select "Save PDF as Postscript..." programatically?

Thanks in advance,

Jaeho,


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: iPhoto integration?
  • Next by Date: programatically printing to a postscript file
  • Previous by thread: Re: Re: Objects as keys NSMutableDictionary
  • Next by thread: programatically printing to a postscript file
  • Index(es):
    • Date
    • Thread