java dwg转svg
Posted james-roger
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java dwg转svg相关的知识,希望对你有一定的参考价值。
package com.example.demo.dxf2svg; import com.aspose.cad.InterpolationMode; import com.aspose.cad.SmoothingMode; import com.aspose.cad.TextRenderingHint; import com.aspose.cad.imageoptions.CadRasterizationOptions; import com.aspose.cad.imageoptions.SvgOptions; /** * Created by Administrator on 2019/9/10. */ public class Test public static void main(String[] args) //加载PDF // String absParsingFile = "D:/dfx/暖气位置建议图.dwg"; String absParsingFile = "C:/file/dfx/暖气位置建议图.dwg"; com.aspose.cad.Image cadImage = com.aspose.cad.Image.load(absParsingFile); CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.setPageWidth(1600); rasterizationOptions.setPageHeight(1600); rasterizationOptions.setAutomaticLayoutsScaling(true); rasterizationOptions.setNoScaling (false); rasterizationOptions.setContentAsBitmap(true); rasterizationOptions.setLayouts(new String[] "Model"); rasterizationOptions.setDrawType(1); SvgOptions svgOptions = new SvgOptions(); svgOptions.setVectorRasterizationOptions(rasterizationOptions); // Set Graphics options rasterizationOptions.getGraphicsOptions().setSmoothingMode(SmoothingMode.HighQuality); rasterizationOptions.getGraphicsOptions().setTextRenderingHint(TextRenderingHint.AntiAliasGridFit); rasterizationOptions.getGraphicsOptions().setInterpolationMode(InterpolationMode.HighQualityBicubic); // Export to PDF by calling the Save method cadImage.save("C:/file/dfx/暖气位置建议图.svg", svgOptions);
以上是关于java dwg转svg的主要内容,如果未能解决你的问题,请参考以下文章