几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 09:50 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】pdf export with plot styles - how

pdf export with plot styles - how?
pdf export with plot styles - how?
hi,
i've written a very simple test program to export a dwg to pdf using pdfexport. i want to export the active layout using its saved page settings and plot styles. it works fine except plot styles are ignored.
i've written a dummy findfile implementation, which is getting called to locate the .ctb file and it definitely returns the correct path. plotplotstyles is true as is showplotstyles.
can anyone tell me what i need to do to export to pdf with plot styles?
this is my first look at dwgdirect so forgive me if this is a dumb question!
tia,
matt.
here's the code:
code:
class myservices : public exsystemservices, public exhostappservices
{
public:
odstring findfile(const odstring& file, oddbbasedatabase* pdb, oddbbasehostappservices::findfilehint hint)
{
odstring sfile = exhostappservices::findfile(file, pdb, hint);
if( !sfile.isempty() )
return sfile;
sfile = "c:\\x\\" + file;
return sfile;
}
};
int main(int argc, char* argv[])
{
odstaticrxobject<myservices> svcs;
odinitialize(&svcs);
try
{
odstring fin(argv[1]);
odstring fout(argv[2]);
oddbdatabaseptr pdb = svcs.readfile(fin.c_str(), true, true, oda::ksharedenyreadwrite);
if (!pdb.isnull())
{
pdfexportparams params;

params.pdb = pdb;
params.ver = pdfexportparams::kpdfv1_4;
params.outputstream = odsystemservices()->createfile(fout.c_str(), oda::kfilewrite, oda::ksharedenyno, oda::kcreatealways);

params.flags = pdfexportparams:dfexportflags(pdfexportparams::kembededttf | pdfexportparams::kshxtextasgeometry);
params.busehlr = 0;

oduint32 errcode = exportpdf(params);

}
}
catch (oderror& e)
{
odprintconsolestring(l"status:dwgdirect error: %ls\n",svcs.geterrordescription(e.code()).c_str());
}
catch (...)
{
odprintconsolestring(l"status:unknown error.\n");
}
please, test mfcapp pdf export with your file and required plotstyles.
what is used toolkit version ?
hi,
thanks for the prompt repy.
im using dwgdirect 2.6.1.0. i tried it in the vc9 build of mfcapp and plot styles were still ignored. for some reason i thought i'd try it in the vc8 build, and it did work! should i use the vc8 libs then?
matt.
hi
please check the name of plotstyleservices_2.06src_9.drx. it seems that vc9 version has wrong drx name for plot style services module.
(plotstyleservices_2.06src_9.drx is required name)
okay, plot styles work in mfcapp now. but what should i be doing in my simple console application to get pdfs to export with plot styles?
thanks
did you used dll or lib version of the toolkit? did you load to your application plotstyleservices_2.06src_9.drx via :drxdynamiclinker()->loadmodule ?
no, i'm using the libs. i linked to dd_vc9md_pdftoolkit.lib, dd_vc9md_pdfexport.lib and dd_vc9md_rxplotstyleservices.lib...
last edited by matt.spencer@mesaware.co.uk; 31st july 2008 at 09:12 amfff">.
so i don't need to do anything more in the code to ensure the .ctb file is loaded and used? exportpdf should take care of it and i'm just not linking to the right module? do i need to dynamically link to plotstyleservices even if i'm using the libs?
apologies if these are dumb questions, i spend most of my time working in php these days :$ ...
thanks
also (see mfcapp as example how to)
you should add for static application
odrx_declare_static_module_entry_point(odpsplotsty leservicesimpl);
and
odrx_define_static_application(odps_plotstyle_serv ices_appname, odpsplotstyleservicesimpl)

hi,
i still had no luck with this i added the static definition and declaration for plot style services but the plot styles are still being ignored.
is there anything else i should be doing?
thanks in advance,
matt.
do you call
odrx_init_static_module_map();
?
(see odamfcapp.cpp for #ifndef _toolkit_in_dll_)

um, no, i didn't... it works perfectly now. thanks a lot for you help.
matt.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】how to export hideline data yang686526 DirectDWG 0 2009-05-06 02:35 PM
【转帖】export pdf with gray scale outpu yang686526 DirectDWG 0 2009-05-05 10:26 AM
【转帖】export a view with scale yang686526 DirectDWG 0 2009-05-05 10:23 AM
【转帖】dwf export problem yang686526 DirectDWG 0 2009-05-04 08:19 PM
【转帖】asdkplotapi <autodesk的开源程序> yang686526 ObjectARX(C++) 0 2009-04-16 09:10 AM


所有的时间均为北京时间。 现在的时间是 04:16 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多