如何转换cdr文件
Posted 威流微信公众平台开发研究工作室
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何转换cdr文件相关的知识,希望对你有一定的参考价值。
You will need to copy the type library from corelDRAW: C:\Program Files (x86)\Corel\CorelDRAW Graphics Suite 13\Programs\CorelDraw.tlb into your /bin folder and create a reference to it. Once you have done this you should be able to export .CDR files to many different formats. The sample code below converts .cdr to .png.
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CorelDRAW;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
CorelDRAW.Application cdr =
new Application();
cdr.OpenDocument(@"C:\Users\user\Desktop\500074.cdr", 1);
cdr.ActiveDocument.ExportBitmap(
@"C:\Users\user\Desktop\newImage.png",
CorelDRAW.cdrFilter.cdrPNG,
CorelDRAW.cdrExportRange.cdrCurrentPage,
CorelDRAW.cdrImageType.cdrRGBColorImage,
0, 0, 72, 72,
CorelDRAW.cdrAntiAliasingType.cdrNoAntiAliasing,
false,
true,
true,
false,
CorelDRAW.cdrCompressionType.cdrCompressionNone,
null).Finish();
cdr.ActiveDocument.Close();
cdr.Quit();
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
This code would convert the .cdr to .pdf:
protected void Button2_Click(object sender, EventArgs e)
{
CorelDRAW.Application cdr =
new Application();
cdr.OpenDocument(@"C:\Users\user\Desktop\500074.cdr", 1);
cdr.ActiveDocument.PublishToPDF(@"C:\Users\user\Desktop\NewImage.pdf");
cdr.ActiveDocument.Close();
cdr.Quit();
}
引用原文件链接:http://stackoverflow.com/questions/4864765/convert-cdr-corel-draw-using-net
以上是关于如何转换cdr文件的主要内容,如果未能解决你的问题,请参考以下文章
CorelDRW 转换 AI 格式时文件变的很大,请问该怎么解决。
sh 将使用DiskUtility.app创建的* .cdr图像转换为带有osX终端的* .iso文件
cdr 2021卸载方法,怎么完全彻底卸载删除清理干净cdr 2021各种残留注册表和文件?