开发者

iOS Printing Custom Paper

I would like to ask for advise about technical issue when printing to custom paper size 6,2Inch*8Inch from iOS application. In this cas开发者_JAVA技巧e iPad application.

The paper size provided by ios, only 4 paper size. so when my paper size is different, the continuity printer to next page will appear not fit.


The documentation says:

Paper sizes and their designations are locale- and printer-specific. Most applications use the default UIPrintPaper object created by UIKit for a print job. However, if an application has special requirements for content areas, the delegate of the UIPrintInteractionController object can return a UIPrintPaper object representing the preferred paper size.

Unfortunately it looks like you can't choose just any paper size; your UIPrintInteractionControllerDelegate has to choose one of the given paper sizes. The best you can do is to call +bestPaperForPageSize:withPapersFromArray: to find the paper size best suited to your content.


This is a late reply but maybe could help others

How about implementing:

 - (UIPrintPaper *)printInteractionController:(UIPrintInteractionController*)printInteractionController choosePaper:(NSArray *)paperList

and then create a custom CGSize using:

CGSize custompapersize = CGSizeMake(6,2 * 72.0, 8.0 * 72.0);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜