• 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
Re: Printing a non document based textView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing a non document based textView


  • Subject: Re: Printing a non document based textView
  • From: Ryan Stevens <email@hidden>
  • Date: Fri, 4 Nov 2005 10:50:58 -0800

You're still using your local copy (which may be nil now) near the end. Instead..

printOp =[NSPrintOperation printOperationWithView:theFolder printInfo:pi];


On Nov 4, 2005, at 7:51 AM, Andrea Salomoni wrote:

Hi and thank you,

I modified the code as follow:

-(void)printShowingPrintPanel:(BOOL)flag
{

//[ self setPInfo: [[NSPrintInfo sharedPrintInfo] copy] ];
NSPrintInfo    * pi =  [NSPrintInfo sharedPrintInfo];
NSPrintOperation * printOp;

[pi setTopMargin:10.0];
[pi setLeftMargin:20.0];

[pi setHorizontallyCentered:NO];
[pi setVerticallyCentered:NO];

printOp =[NSPrintOperation printOperationWithView:theFolder printInfo:pInfo];
NSLog (@"info:%@", pInfo);
[printOp runOperation];
}


But still not work... the text is always in the middle of the page.

Thank you all for support


Inizio messaggio inoltrato:


Da: Ryan Stevens <email@hidden>
Data: 04 novembre 2005 16:57:59 GMT+01:00
A: Andrea Salomoni <email@hidden>
Cc: email@hidden
Oggetto: Re: Printing a non document based textView

NSPrintInfo    * pi =  [NSPrintInfo sharedPrintInfo];

Use the object returned by +sharedPrintInfo instead of a copy.

On Nov 4, 2005, at 6:58 AM, Andrea Salomoni wrote:


Hi to all,

I'm trying to print a textView in a non document based app.
I wrote this code:

-(void)printShowingPrintPanel:(BOOL)flag
{

[ self setPInfo: [[NSPrintInfo sharedPrintInfo] copy] ];
NSPrintInfo    * pi = [ self pInfo ];
NSPrintOperation * printOp;

[pi setTopMargin:10.0];
[pi setLeftMargin:20.0];

[pi setHorizontallyCentered:NO];
[pi setVerticallyCentered:NO];

printOp =[NSPrintOperation printOperationWithView:theFolder printInfo:pInfo];
//[printOp runOperation];
}


trying to set the margins... but the app continue to print the text in the middle of the page...
How can I do?


Thank you all for support

Yorh





_______________________________________________ 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


_______________________________________________ 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
  • Follow-Ups:
    • Re: Printing a non document based textView
      • From: Andrea Salomoni <email@hidden>
References: 
 >Re: Printing a non document based textView (From: Ryan Stevens <email@hidden>)
 >Printing a non document based textView (From: Andrea Salomoni <email@hidden>)

  • Prev by Date: Re: Registering file types...
  • Next by Date: Subclassing NSButton
  • Previous by thread: Printing a non document based textView
  • Next by thread: Re: Printing a non document based textView
  • Index(es):
    • Date
    • Thread