을 알려 주시기 바랍니다. 다음은 나를 위해 원하는 기능을 제공하는 일부 논리입니다.
//
// PrintDocument_inst
//
this.PrintDocument_inst.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.k_line_PrintPage);
private void Print(string align_file_name)
{
if (plot_metafile == null)
{
MessageBox.Show("you need to load offset data before printing a plot");
return;
}
try
{
PrintDocument_inst.DefaultPageSettings = PageSettings_inst;
PrintDialog_inst = new PrintDialog();
PrintDialog_inst.Document = PrintDocument_inst;
PrintDialog_inst.UseEXDialog = true; // this must be set true or dialog won't show on 64 bit Vista
PrintDialog_inst.PrinterSettings.PrinterName = "Microsoft XPS Document Writer";
PrintDialog_inst.PrinterSettings.PrintToFile = true;
PrintDialog_inst.PrinterSettings.PrintFileName = align_file_name;
i_page_to_print_next = 1;
n_pages_still_to_print = 1;
PrintDocument_inst.Print();
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
finally
{
}
} // end of function Print(string align_file_name)
//PrintPage event handler
private void k_line_PrintPage(object sender,PrintPageEventArgs ppea)
{
int leftMargin = ppea.MarginBounds.Left;
int topMargin = ppea.MarginBounds.Top ;
try
{
float _scale_f;
if (PrintDialog_inst != null)
{
string str_printer_name = PrintDialog_inst.PrinterSettings.PrinterName.ToString ();
if (str_printer_name.CompareTo ("Adobe PDF") == 0)
{
_scale_f = 0.61F; // 0.85F;
}
else
{
_scale_f = 0.59F; // 0.82F;
}
}
else // case of print preview
{
_scale_f = 0.59F; // 0.82F;
}
if (_scale_f != 1.0F) ppea.Graphics.ScaleTransform (_scale_f, _scale_f);
ppea.Graphics.DrawImage (plot_metafile, leftMargin, topMargin);
ppea.HasMorePages = (--n_pages_still_to_print > 0 ? true : false);
}
finally
{
}
} // end of private void k_line_PrintPage(object sender,PrintPageEventArgs ppea)
문제를 조금 명확하게 할 수 있습니까? 어떤 언어로 작업하고 있습니까? 응용 프로그램에서 XPS 출력을 만들려고 구체적으로 시도하고 있습니까? 아니면 단순히 XPS Document Writer가 기본 드라이버 일 때 팝업 대화 상자가 자동화 된 워크 플로가되어야하는지 방해하고 있습니까? – Jon
어쩌면 읽은 링크 중 일부는 문제 해결에 도움이 될만한 정보일지도 모릅니다. – Nocturnal
Jon - 질문은 프린터 드라이버를 만드는 방법입니다. 컴퓨터의 기본 프린터로 인쇄하는 자동 프로세스입니다. - 야행성, 고마워,하지만 사실 나는이 솔루션을두고 타사 제품을 구입했다. –