0

Coming from Android I am new to iOS development and need advice :-)

In a current project I need to print variable content (product, map and cam-picture) in high resolution in duplex mode via airprint. The structure and layout (of the pages) is delivered via JSON-File.

  1. Is there a decent way to generate a "layout-framework" to separate the displayed views/content on screen and the content to be printed as I do not need the high resolution for display purposes? Any projects dealing with similar approaches to start from someone can advice? Any kind of "JSON to layout/structure parser"?

  2. Is it in general possible to print duplex high-resolution content maybe even borderless if the printer supports this mode? Could not find an answer here: ...developer.apple.com/library/ios/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/Printing/Printing.html

  3. What is the smartest way to render the print content? Rendering a second high resolution "print-view" offscreen or generate a pdf and print that? This I found this.

  4. How would I airprint with swift given the requirements can be addressed? A good starter I found here.

R3tep
  • 12,512
  • 10
  • 48
  • 75
emte
  • 1
  • 1

1 Answers1

0

Overall, I find WWDC session videos about printing to be excellent primers and provide great answers to what's there. It covers the content in the Printing page you linked but in more task-oriented detail. Between the tools to use views, draw with Core Graphics/Quartz (which can work with PDFs) and providing the content as HTML to be printed by WebKit, you should be able to find a good approach.

Most printer features you could ask for are there. Beyond B&W/color inkjet/laser printers, iOS printing supports both large-format printers as well as even line printers. Both duplex printing and borderless printing are definitely supported.

As for 4: Just write the same code you would write in Objective-C, but do it in Swift. Any library, including what Apple provides, that helps you print from Objective-C can be used from Swift.

Jesper
  • 7,477
  • 4
  • 40
  • 57
  • Thanks Jesper for the answer. Those videos (2012:234, 2013:711, 2014:718) I watched and got to know that UIPrintInfoOutputPhoto in high quality does not allow for duplex (718_adopting_airprint:42) hence I wonder if there is a way to circumvent this restriction. Otherwise I think I´ll have to take the pdf approach. – emte Apr 22 '15 at 09:45
  • I think "normal quality" is a relative measure - most photo printers do not support duplex for the reason that photos and photo paper are not naturally duplex, but on printers geared towards high-resolution output where you are meant to be able to print duplex, normal quality will be high quality. – Jesper Apr 22 '15 at 11:06