我用的一个笨办法:sWidth=''; for i:=0 to 255 do sWidth=sWidth+' 1024'; PDFDocumentFilter1.AddCustomWidths('SimSun', sWidth); rpt.ExporttoFilter(PDFDocumentFilter1);这样可以保证输出的字符宽度,但是不方便的是必须指定字体名称,如果你换过一种中文字体,就需要修改程序。:-(
忠心感谢 wjowner(Jerry.W),在你的提示下,我加了如下代码,已经正功的导出了PDF,所有的中文字已经显示成功了。 for i:=0 to 255 do sWidth:=sWidth+' 1024'; AFilter.AddCustomWidths('宋体', sWidth); AFilter.AddCustomWidths('宋体,bold', sWidth); AFilter.AddCustomWidths('楷体_GB2312', sWidth);结帖^:^
for i:=0 to 255 do
sWidth=sWidth+' 1024';
PDFDocumentFilter1.AddCustomWidths('SimSun', sWidth);
rpt.ExporttoFilter(PDFDocumentFilter1);这样可以保证输出的字符宽度,但是不方便的是必须指定字体名称,如果你换过一种中文字体,就需要修改程序。:-(
sWidth:=sWidth+' 1024';
AFilter.AddCustomWidths('宋体', sWidth);
AFilter.AddCustomWidths('宋体,bold', sWidth);
AFilter.AddCustomWidths('楷体_GB2312', sWidth);结帖^:^