AnsweredAssumed Answered

Edrawing API Print to PDF

Question asked by James Smith on Feb 26, 2018
Latest reply on Mar 1, 2018 by Erhard Wuertz

Hi Guys,

I am new here and trying to print the drawing to pdf using edrawing control i can get the drawing to open but the printing part i am not having much luck with.

Here is the code i am using. If anyone of you done anything similar please share with me what i am doing wrong.

 

using System.Text;

using System.Runtime.InteropServices;

using System.Text.RegularExpressions;

using System.Configuration;

using System.Windows.Forms;

using System.Collections.Generic;

using System.Threading.Tasks;

using eDrawingHostControl;

namespace WindowsFormsApplication1

 

{

    public partial class Form1 : Form

    {

        eDrawingHostControl.eDrawingControl ctrl = null;

        public Form1()

        {

            InitializeComponent();

            if (null == ctrl)

            {

                ctrl = new eDrawingControl();

            }

            this.Controls.Add(ctrl);

        }

        private void Form1_Load(object sender, System.EventArgs e)

        {

        }

        private void button1_Click(object sender, System.EventArgs e)

        {

            if (ctrl != null)

            {

                ctrl.Location = new Point(0, 0);

                ctrl.Size = new System.Drawing.Size(this.Size.Width, this.Size.Height);

 

 

                ctrl.eDrawingControlWrapper.OpenDoc("c:\\107010.slddrw", false, false, true, "");

 

 

          

 

 

               // ctrl.eDrawingControlWrapper.Print5(true, _T("test"), false, false, true, EModelView.EMVPrintType.eScaleToFit, 0, 0, 0, true, 0, 0, _T(""));

//instance.Print5(ShowDialog, FileNameInPrintQueue, Shaded, DraftQuality, Color, printType, scale, centerOffsetX, centerOffsetY, printAll, pageFirst, pageLast, PrintToFileName)

            

               

            }

        }

 

 

        private void button2_Click(object sender, EventArgs e)

        {

            ctrl.eDrawingControlWrapper.Print4(false, "c:\\107010.slddrw", false, true, true, EModelView.EMVPrintType.eScaleToFit, 0, 0, 0, true, 0, 0);

        }

 

 

       

    }

}

Thanks

James

Outcomes