는 상관없이 내가 선택하는 프린터, 나는 "인쇄 작업이 실패 : 지원되지 않는 문서 형식"얻을 실패합니다. 응용 프로그램/PDF을 "아이폰 4.2 AirPrint를 인쇄 작업이
내가 HP 프린터에서만 인쇄하려고
.나는 출력 유형을 변경하는 코드의 곳을 볼 수 없습니다.
내가 문자열의 형식을 UISimpleTextFormatter을 사용하고 있습니다.
확실하지 ARO하는 방법을 이 하나.
편집 : 아래 코드는 미구엘의 예와 똑같습니다. 유일한 차이점은 markupformatter를 사용하여 응용 프로그램/pdf이 아닌 다른 형식으로 출력되는지 확인해 보았습니다.
인쇄 대화 상자에 HP 프린터 목록이 나타나고 프린터를 선택했지만 아무 것도 인쇄되지 않고 디버그 모드로 나타나면 맨 위에 지정된 오류가 기록됩니다. UIPrintInfoOutputType.General이외의
, 나는 또한하지만 같은 효과 UIPrintInfoOutputType.GrayScale을 시도했습니다.
public partial class AppDelegate : UIApplicationDelegate
{
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window.MakeKeyAndVisible();
var button = UIButton.FromType (UIButtonType.RoundedRect);
button.Frame = new RectangleF (100, 100, 120, 60);
button.SetTitle ("Print", UIControlState.Normal);
button.TouchDown += delegate {
Print();
};
window.AddSubview (button);
return true;
}
void Print()
{
var printInfo = UIPrintInfo.PrintInfo;
printInfo.JobName = "Test :";
printInfo.OutputType = UIPrintInfoOutputType.General;
printInfo.JobName = "Test: My first Print Job";
/*
var textFormatter = new UISimpleTextPrintFormatter ("Once upon a time...") {
StartPage = 0,
ContentInsets = new UIEdgeInsets (72, 72, 72, 72),
MaximumContentWidth = 6 * 72,
};
*/
var htmlFormatter = new UIMarkupTextPrintFormatter("<html><body>Test : Hi There!!</body></html>");
htmlFormatter.StartPage = 0;
htmlFormatter.ContentInsets = new UIEdgeInsets (72, 72, 72, 72); // 1 inch margins
htmlFormatter.MaximumContentWidth = 6 * 72;
var printer = UIPrintInteractionController.SharedPrintController;
printer.PrintInfo = printInfo;
printer.PrintFormatter = htmlFormatter;
printer.ShowsPageRange = true;
printer.Present (true, (handler, completed, err) => {
if (!completed && err != null){
Console.WriteLine ("error");
}
});
}
public override void OnActivated (UIApplication application)
{
}
}
몇 가지 예제 코드를 게시 할 수 있습니까? – iamandrus