The font size is incorrect after converting dwg to PDF.
PDF:1699413026759.png (70.2 KB)
DWG:1699413084990.png (31.1 KB)
DWG:
A3图框(新)-1.zip (24.4 KB)
The font size is incorrect after converting dwg to PDF.
PDF:1699413026759.png (70.2 KB)
DWG:1699413084990.png (31.1 KB)
DWG:
A3图框(新)-1.zip (24.4 KB)
@hardp,
this text uses SHX font, you can try to apply proper setting along with LoadOptions, e.g.:
LoadOptions loadOptions = new LoadOptions();
loadOptions.SpecifiedEncoding = CodePages.SimpChinese;
using (CadImage cadImage = (CadImage)Aspose.CAD.Image.Load(GetPath(fileName), loadOptions))
{
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();
cadRasterizationOptions.PageSize = new SizeF(1500, 1500);
cadRasterizationOptions.Layouts = new string[] { "Model" };
cadRasterizationOptions.ShxFonts = new string[]
{
@"pathTo\hzfs.shx",
};
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = cadRasterizationOptions;
cadImage.Save(outPath, pdfOptions);
}
We don’t have other romans-h.shx font used in this file, you can try to apply it too.
ctbFileStream = new FileStream(ctbPath, FileMode.Open);
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = windowWidth;
rasterizationOptions.PageHeight = windowHeight;
rasterizationOptions.DrawType = CadDrawTypeMode.UseObjectColor;
rasterizationOptions.VisibilityMode = VisibilityMode.AsPrint;
rasterizationOptions.Zoom = 1f;
rasterizationOptions.NoScaling = false;
rasterizationOptions.ScaleMethod = ScaleType.ShrinkToFit;
rasterizationOptions.RenderMode3D = RenderMode3D.Wireframe;
IDictionary<string, Stream> keyValuePairs = new Dictionary<string, Stream>();
keyValuePairs.Add(“test”, ctbFileStream);
rasterizationOptions.CtbSources = keyValuePairs;
rasterizationOptions.Quality.Text = RasterizationQualityValue.High;
rasterizationOptions.ShxFonts = new string[] { { “D:\Work\CAD\Fonts\ROMANS-H.SHX” };
rasterizationOptions.AutomaticLayoutsScaling = true;
pdfOptions.VectorRasterizationOptions = rasterizationOptions;
cadImage.Save(outputFilePath, pdfOptions);
PDF:
1699583186270.png (41.7 KB)
1699583216781.png (19.4 KB)
DWG:
1699583243922.png (4.8 KB)
Font:
ROMANS-H.zip (7.2 KB)
There are two more questions:
The font is still garbled after setting.
After exporting the vertical text to PDF, it becomes horizontal.
@oleksii.gorokhovatskyi
@hardp
I can see the issue, I guess we don’t have support for the vertical SHX text.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CADNET-9482
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.