UG爱好者
标题:
函数ProPrintExecute该怎么用才能将工程图打印到硬盘里
[打印本页]
作者:
yikeshu2009152*
时间:
2011-6-16 09:37
标题:
函数ProPrintExecute该怎么用才能将工程图打印到硬盘里
有没有人搞二次开发工程图打印的?函数ProPrintExecute该怎么用才能将工程图打印到硬盘里并保存为jpg格式的图片?我的代码如下:ProPath path;
ProPlotPaperSize size =
{
A4_SIZE_PLOT
};
int width = 297;
int height = 210;
ProPrintSize papersize =
{
size,
(double)width,
(double)height
};
int slew = 0;
ProPrintPrinterOpts PrinterOpts =
{
"JPEG",
///File related options
PRO_B_TRUE,
PRINT_SAVE_SINGLE_FILE,
//name,
PRO_B_FALSE,
///Print command options
PRO_B_FALSE,
//path,
//path,
1,
///Printer specific options
PRO_B_TRUE,
PRO_B_FALSE,
PRO_B_FALSE,
(double)slew,
PRO_B_FALSE
};
ProPrintMdlOpts PrintMdlOpts =
{
&model,
3,
///Options available only with solid objects
PRO_B_TRUE,
///Options available only with drawing objects
PRO_B_TRUE,
PRO_B_TRUE,
PRO_B_TRUE,
PRO_B_FALSE,
//name,
PRINT_CURRENT_SHEET,
0
};
int scale = 1,label_height=0;
double ofset[2]={0,0}, clip_area[2][2]={{0.000000,0.000000},{1.000000,1.000000}};
ProPrintPlacementOpts PlaceOpts =
{
(double)scale,
ofset[2],
PRO_B_FALSE,
///options for clipping
PRO_B_TRUE,
PRO_B_TRUE,
PRO_B_TRUE,
///options for label
PRO_B_FALSE,
NULL//(double)label_height
};
ProPrintPrinterOptionsGet("JPEG",&PrinterOpts);
ProPrintMdlOptionsGet(&model,&PrintMdlOpts);
ProPrintPlacementOptionsGet(&PlaceOpts);
err = ProPrintExecute(w_id,&PrinterOpts,&PrintMdlOpts,&PlaceOpts);
编译没有问题,但就是打印不出来文件,请问各位大侠,我的代码哪里出问题了?
欢迎光临 UG爱好者 (https://www.ugsnx.com/)
Powered by Discuz! X3.2