几何尺寸与公差论坛------致力于产品几何量公差标准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:52 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】pdf-export specific german characters

pdf-export: specific german characters
pdf-export: specific german characters
hello,
we have a second problem in pdf- and dwf-export.
we create a dwgdirect database an make outputfiles in several formats (dwg, dxf, pdf, dwf). the beginning is always the same. at the end we use the dwgdirect-functions writefilefff">, exportdwffff"> and exportpdffff">.
with dwg and dxf we have no problems with german characters (? ? ? ? ...). but in pdf and dwf, these charcters will changed in '?'. but only in non-ttf-fonts (z.b. txt.shx)! arial (z.b) will be correct!
what can we do?
in an other thread we read something about preferences.files.supportpath. but we don't have an own application class because we only use the functions writefilefff">, exportdwffff"> and exportpdffff">. and in dwg/dxf-export our way is correct!
sorry for the bad english description.
does saving to dxf and dwg work for both autocad 2000 and autocad 2006?
sergey slezkin
hello,
that's a good question. and i think, the problem is deeper than i thougt!
in autocad2006 all versions (12,13,14,2000,2004 in dwg and dxf) are correkt.
in your odamfcapp all versions (12,13,14,2000,2004,2007 in dwg and dxf) are wrong.
in intellicad (but an older version) the dwg-and dxf-versions 12,13,14,2000 are correct, the dwg-versions 2002, 2007 can't be read, the dxf-version 2004 is correct and the dxf-version 2007 is wrong.
perhaps the two dxf-files can help to find the cause.
thanks
file formats are:
12, 13, 14,
15 (ac2000 - a2002)
18 (ac2004 - ac2006)
21 (ac2007 - ac2009)
the last one (starting with ac2007) stores texts in unicode.
dwgdirect starting with 2.0 stores texts in unicode too.
so difference in dispaying texts from different versions is possible.
dwg files you attached are of r15 (2002), r18 (2004) and r21 (2007) versions.
on my computer (russian regional settings) all of them are displayed ok by ac2008, odamfcapp, ac2005 and ac2000i.
surely file of r21 (2007) version can't be opened by ac2000 or ac2005.
you wrote that you have no problems with exporting ttf text and shx is wrong.
do you export to pdf shx text as geometry (lines not text)?
if you export shx text as polylines it may be that your application has no access to .shx fonts, in that case it may use built into dwgdirect simplex font which has no german characters.
which dwgdirect version do you use?
odamfcapp should display all your files correctly on computer with installed autocad (it searchs for autocad shx fonts). on computer without autocad installed odamfcapp will display all shx text with built-in simplex.
sergey slezkin
hello sergey,
thanks for the informations. first, the answers to your questions:
1. actually we use dwgdirect 2.6.1, but also in 2.5.2 the results were the same.
2. we have no autocad on our cmputers tu use their shx-fonts.
3. but we have the shx-files in an extra-directory on our computers.
4. we tried both, shx-fonts as lines or text, but without any effects.
so, we thougt the problem is, that the program can't find this shx-files. but what can we do? we create an odstaticrxobject-object, filled an oddb-database and called the function exportpdf. we found no such membervariable for oddbdatabaseptr or odstaticrxobject.
where we can / must define the directory with the shx-files?
here are some parts of our program:
odstaticrxobject<myexportservices> m_svcs;
odinitialize(&m_svcs);
try
{
odstring sname;
odwrfilebuf fb(m_exportfilename.c_str());
m_svcs.disableoutput(true);
m_svcs.resetpatternmanager();
odcodepageid systemcodepageid = m_svcs.systemcodepage();
if (systemcodepageid == cp_undefined)
{
systemcodepageid = cp_ansi_1252;
m_svcs.setsystemcodepage(systemcodepageid);
}
oddbdatabaseptr pdb = m_svcs.createdatabase(true, oddb::kmetric);
pdb->setmeasurement(oddb::kmetric);
oddbsetdwgcodepage((*pdb.get()), m_svcs.systemcodepage());
exportfiller filler(this);
filler.filldatabase(pdb, m_ppatternarray, m_patterncount, imusterindex);
if ((m_fileformat == "dxf") || (m_fileformat == "dwg"))
{
oddb::savetype odfileformat = oddb::kdxf;
if (m_fileformat == "dwg")
odfileformat = oddb::kdwg;
pdb->writefile(&fb, odfileformat, m_fileversion, true, 15); // true -> with save preview
}
else if ((m_fileformat == "pdf")
{
pdfexportparams pdfparams;
bool m_bembedded = false;
bool m_bsimplegeomopt = false;
bool m_bshxasgeometry = true;
bool m_bttfasgeometry = true;
bool m_bzoomtoextents = true;
bool m_benablelayers = false;
bool m_bexportofflayers = false;
if (m_pdfversion == 150)
{
m_benablelayers = true;
m_bexportofflayers = true;
}
double m_dpaperh = 100;
double m_dpaperw = 100;
int m_layouts = 1;
bool m_busehlr = true;
m_dpaperw = pdfpageparams().getpaperheight();
m_dpaperh = pdfpageparams().getpaperwidth();
if (!m_benablelayers)
m_bexportofflayers = false;
bool bv15 = m_benablelayers || m_bexportofflayers;
pdfparams.pdb = pdb;
pdfparams.ver = bv15 ? pdfexportparams::kpdfv1_5 : pdfexportparams::kpdfv1_4;
pdfparams.outputstream
= odsystemservices()->createfile(odstring(m_exportfilename.c_str()), oda::kfilewrite, oda::ksharedenyno, oda::kcreatealways);
pdfparams.flags = pdfexportparams:dfexportflags
(
(m_bembedded ? pdfexportparams::kembededttf : 0) |
(m_bshxasgeometry ? pdfexportparams::kshxtextasgeometry : 0) |
(m_bttfasgeometry ? pdfexportparams::kttftextasgeometry : 0) |
(m_bsimplegeomopt ? pdfexportparams::ksimplegeomoptimization : 0) |
(m_bzoomtoextents ? pdfexportparams::kzoomtoextentsmode : 0) |
(m_benablelayers ? pdfexportparams::kenablelayers : 0) |
(m_bexportofflayers ? pdfexportparams::kincludeofflayers : 0) );
pdfparams.title = "";
pdfparams.author = "";
pdfparams.subject = "";
pdfparams.keywords = "";
pdfparams.creator = "";
pdfparams.producer = "";
pdfparams.busehlr = m_busehlr != 0;
if (m_layouts == 1)
{
oddbdictionaryptr playoutdict = pdb->getlayoutdictionaryid().safeopenobject();
oddbdictionaryiteratorptr pit = playoutdict->newiterator();
while(!pit->done())
{
oddblayoutptr playout = pit->getobject();
odstring sname = playout->getlayoutname();
if (playout->getblocktablerecordid() == pdb->getmodelspaceid())
{
pdfparams.layouts.insertat(0, sname);
}
else
{
oddbblocktablerecordptr prec = playout->getblocktablerecordid().safeopenobject();
oddbobjectiteratorptr pit = prec->newiterator();
bool bempty = pit->done();
if (!bempty)
pdfparams.layouts.push_back(sname);
}
pit->next();
}
}
oduint32 npages = odmax(1, pdfparams.layouts.size());
pdfpageparams pageparams;
pageparams.set(m_dpaperw, m_dpaperh);
pdfparams.pageparams.resize(npages, pageparams);
oduint32 errcode = exportpdf(pdfparams);
}
}
in order to make dwgdirect using shx fonts from a specific folder you can override oddbhostappservices::findfile() or use "acad" system environment variable.
for details see developer's guide/introduction/font handling.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】how to export hideline data yang686526 DirectDWG 0 2009-05-06 02:35 PM
【转帖】german characters, export in dxf yang686526 DirectDWG 0 2009-05-05 11:13 AM
【转帖】dwf export problem yang686526 DirectDWG 0 2009-05-04 08:19 PM
【转帖】dwf export module - japanese characters yang686526 DirectDWG 0 2009-05-04 08:17 PM
Unicode、UCS、UTF、BMP、BOM huangyhg vc编程 2 2007-01-22 05:43 PM


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


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