Questions tagged [nsprintoperation]
57 questions
0
votes
0 answers
How to get NSPrintInfo and NSPrintOperation to use "borderless" paper on preset sizes?
Using NSPrintInfo (shared or not) if I specify a paper size using printInfo?.paperSize that is not in the list of paper sizes defined in the NSPrintOperation panel paper size dropdown and set the margins to zero
printInfo?.leftMargin =…

Chris Walken
- 378
- 1
- 9
0
votes
0 answers
How to find where NSPrintOperation created the saved PDF (NSPrintSaveJob)
I'm using NSPrintOperation to optionally print or save as PDF. It works great, however, when using Save as PDF (NSPrintSaveJob), NSPrintOperation will put up a standard File Save dialog, and the user can CHANGE the proposed name.
I haven't been…

SMGreenfield
- 1,680
- 19
- 35
0
votes
1 answer
Unable To Print Multipage Print Preview With NStableView Data Cocoa App
I want to Print NSTableVIew data as multi page print preview but print preview shows only first few records rest pages are empty.I am using below code to print NStableView data.
let printInfo = NSPrintInfo.shared
printInfo.paperSize = NSSize(width:…

sandeep
- 19
- 3
0
votes
0 answers
NSPrintOperation creates a blank page
I am not able to print in Cocoa using the service:
[[NSPrintOperation printOperationWithView:self] runOperation];
The print dialog gets launched but the preview is blank.
Please let me know what could be the issue?
I have a CGImage (iImageRef) which…

amit kulkarni
- 1
- 1
0
votes
1 answer
Printer options only offer portrait, no option to switch
I'm using [[NSPrintOperation printOperationWithView:drawingView] runOperation]; and I get this view:
There is no option to choose between Landscape or Portrait
I found that I can have [[NSPrintOperation printOperationWithView:drawingView…

Thomas
- 8,306
- 8
- 53
- 92
0
votes
0 answers
How to cancel a NSPrintOperation
Is it possible to cancel an already running NSPrintOperation? I have the following code:
let printOp: NSPrintOperation = NSPrintOperation(view: ..., printInfo: ...)
printOp.jobTitle = "Custom Print"
printOp.showsPrintPanel =…

JoeBayLD
- 939
- 2
- 10
- 25
0
votes
1 answer
How can I change page orientation within a multi page NSPrintOperation?
Let's say that I have a three page report that I want to print out, first page is portrait orientation, second page is landscape, and third page is again portrait.
I've subclassed a special NSView to be my printing operation, but what I get is three…

Dale Jensen
- 45
- 6
0
votes
1 answer
Add 'PageSetupAccessory' to PrintPanel for PDFDocument
I have an app which displays a PDFView, and I want it to print the PDF file from the view. Also, I want the Print panel to show the Page Setup Accessory (i.e. the Paper Size, Orientation and Scale settings, like in Preview, which appear as one panel…

benwiggy
- 1,440
- 17
- 35
0
votes
0 answers
Printing a custom NSTextView
Trying to setup printing from a custom NSTextView (which uses TextKit components). This is what I now do using a second view:
override func printView(_ sender: Any?) {
let printTextView = MyTextView(frame: view.frame, textContainer:…

koen
- 5,383
- 7
- 50
- 89
0
votes
0 answers
NSPrintOperation spins color wheel several seconds in sandboxed Mac application
The following simple call to NSPrintOperation started running very slow and spinning color wheel:
NSPrintInfo* printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintOperation* opeation = [NSPrintOperation printOperationWithView:[self view]…

Alexander B
- 407
- 2
- 17
0
votes
2 answers
NSPrintOperation context is always nil, causing a crash. How do I set the context when printing?
I have a custom NSView that I want to print. After setting things up with the NSView and the print options, I make this call:
NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView: printView printInfo:…

Dale Jensen
- 45
- 6
0
votes
1 answer
print NSImage from cocoa application
I'd like to print a NSImage but haven't managed to succeed yet.
I'd like the image via a standard print panel from my cocoa application.
Could anybody help me please?
Your help would be really appreciated!
Best regards!

user661577
- 201
- 1
- 2
- 5
0
votes
0 answers
Printing NSView to PDF not working as expected
I converted in PDF an NSView (PDFContentView:NSView) with the method NSPrintOperation. This NSView contains 2 subviews (Drawing:NSView). This subviews are drawn using the drawRect method.
The expected result is correct when I display my view in a…

Jeff Dolphin
- 47
- 6
0
votes
1 answer
Print NSImage in Correct Size
I am trying to print an NSImage but am having trouble getting it to be to proper size. I want the NSImage to be printed as a 4"x6" photo on any paper large enough. Here's the code I have now.
var printView = NSImageView(frame: NSRect(x: 0, y: 0,…
user4991637
0
votes
1 answer
Print the first side of the web view different
I'm working with Swift 4 for macOS and I can load a HTML string into my web view and print this with my code:
let printInfo = NSPrintInfo.shared
printInfo.isHorizontallyCentered = true
printInfo.isVerticallyCentered = true
printInfo.orientation =…

Trombone0904
- 4,132
- 8
- 51
- 104