using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn_Convert_Click(object sender, EventArgs e)
    {
        //dwg2pdf
        string inputFile = Server.MapPath("Office.dwg");
        string outputFile =  Server.MapPath(DateTime.Now.ToString("yyMMddhhmmss") + ".pdf");

        DWGTOPDFXLib.ConvertPDFClass dwg2pdf = new DWGTOPDFXLib.ConvertPDFClass() ;
        dwg2pdf.AddExcudeLayer("Defpoints");  //OffLayers
        dwg2pdf.Width = 250;   //uint is mm
        dwg2pdf.Height = 150;  //uint is mm
        dwg2pdf.ColorMode = 1; //1--white&black 0--256color mode
        dwg2pdf.InputFile = inputFile;
        dwg2pdf.set_PenWidth(1, 0.02);
        dwg2pdf.PsPath = Server.MapPath("PS"); //set postscript support files path. Please copy the PS files to the right location and add it here.
        dwg2pdf.Convert(outputFile);
        Response.Write("Conversion complete" + outputFile);
	    
    }
}
