Questions tagged [nsprintinfo]

19 questions
2
votes
1 answer

NSPrintOperation NSprintInfo printer mac osx swift

I am trying to print tickets on a thermal printer with my Mac. With that I have no problems. I use NSPrintOperation to perform the operation, assisted by NSPrinterInfo to the issue of margins and other settings. The problem is that when I send the…
Chus
  • 57
  • 4
2
votes
1 answer

Automatically open PDF in Preview when printing

I'm setting jobDisposition to NSPrintPreviewJob in NSPrintInfo, but the value seems to be ignored. Instead of opening the document in Preview, the print operation displays the print panel as usual.
paulmelnikow
  • 16,895
  • 8
  • 63
  • 114
1
vote
0 answers

When to resize my NSView for printing?

I have an NSView subclass specifically for printing. I want it to fit the width to the page and the height to the number of records. But I haven't really found a good spot to size the view. I'm currently sizing the view in -beginDocument (because I…
uliwitness
  • 8,532
  • 36
  • 58
1
vote
2 answers

Objective-C get list of all custom papers

I'm working on a little framework and I need to get a list of all available custom papers In the Core Printing Reference there's only a method called PMPrinterGetPaperList, but it doesn't return custom paper: This function obtains a list of the…
dominic.e
  • 286
  • 3
  • 17
1
vote
2 answers

How do I set the printInfo to print in landscape in OS X?

I have set the following code: let printInfo = NSPrintInfo.sharedPrintInfo let textPrint = NSPrintOperation(view: theTextView,printInfo: printInfo()) Now I would like to set the orientation to Landscape, but I can't find any Swift functions that do…
TMan
  • 11
  • 2
1
vote
2 answers

Need to Print a Custom Header using obj-c

I am creating an NSView and it prints fine with this piece of code : NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo]; [printInfo setHorizontalPagination:NSFitPagination]; [printInfo setHorizontallyCentered:YES]; [printInfo…
Yogu
  • 23
  • 3
1
vote
1 answer

How to know if print operation was cancelled?

I am using (NSPrintOperation *)printOperationWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo method to print a view in my OS X app. All works as expected. Is there a way to catch the event when the user has cancelled the print operation…
DORI
  • 54
  • 1
  • 8
0
votes
0 answers

How to get my job properly in NSPrintPanel?

I want to get which button I clicked in NSPrintPanel. I find NSPrintInfo.shared.jobDisposition shows the operation. extension NSPrintInfo.JobDisposition { public static let spool: NSPrintInfo.JobDisposition public static let preview:…
Ivan
  • 3
  • 4
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 =…
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

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
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
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
0 answers

Swift macOS how to print with NSPrintInfo and NSAttributedString

I want to print out a list in my App. However if the list is too large to fit on one page there is a problem with the last and the first line on a page. e.g. the last line on a page is cropped and some parts are shown on top of next page.…
Oliver Koehler
  • 711
  • 2
  • 8
  • 24
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
1
2