|
首先我要说明的是,打印程序和遍历文件夹程序都是网上找别人的,可是整合不好,所以发上来跟大家讨论讨论问题出在哪里
能遍历所有的文件了,就是只能打印第一个,打印第二个就会出错,所以可能问题是出在打印程序上,但是小弟实在不知道如何DEBUG,所以发上来跟大家探讨探讨
//先把打印功能写下来
void print(TCHAR filefullpath[MAX_PATH])
{ UF_PLOT_job_options_t job_options;
UF_PLOT_banner_options_t banner_options;
char *job_name;
int copies;
tag_t display_part;
tag_t drawing_sheet;
UF_PART_load_status_t error_status;
//然后判断当前是否有打开的prt
display_part = UF_PART_ask_display_part();
if (display_part == NULL_TAG)
{
/*return;*/
//如果没有,则打开路径上的prt
UF_PART_open(filefullpath,&display_part,&error_status);
}
/* If no part is displayed, do nothing. */
/*
Get the default job options and banner options for use in
the "print" call for each sheet
*/
UF_CALL( UF_PLOT_ask_default_job_options( &job_options) );
UF_CALL( UF_PLOT_ask_default_banner_options( &banner_options ) );
copies = 1;
drawing_sheet = NULL_TAG;
while ((UF_CALL(UF_OBJ_cycle_objs_in_part(display_part,
UF_drawing_type,
&drawing_sheet)) == ERROR_OK) &&
(drawing_sheet != NULL_TAG))
{
/* Supplying a drawing sheet tag causes the default job
name to have the sheet name appended to it
*/
UF_CALL( UF_PLOT_ask_default_job_name( drawing_sheet, &job_name ) );
/* Print the sheet. The "Printer One" printer MUST be
defined in the default Printer group for your system.
The "<System Profile>" profile is the default SDI
profile. You can alter these two parameters to match
your installation.
*/
UF_CALL( UF_PLOT_print( drawing_sheet, &job_options, job_name,
&banner_options, "PDFCreator",
"A4", copies ) );
UF_free( job_name );
}
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|