Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PdfDocument document = new PdfDocument();
- PdfPage page = document.AddPage();
- XGraphics gfx = XGraphics.FromPdfPage(page);
- XFont fontÜberschrift = new XFont("Arial", 17, XFontStyle.Bold);
- XFont fontArial = new XFont("Arial", 10, XFontStyle.Regular);
- XFont fontDEMO = new XFont("Arial", 30, XFontStyle.Bold);
- XTextFormatter tf = new XTextFormatter(gfx);
- //Aufbau des Footers
- XPen pen = new XPen(XColors.Black, 2);
- XPen penSmall = new XPen(XColors.Black, 0.5);
- //Rechteck Außen
- gfx.DrawLine(pen, 40, 40, 40, 800); //Oben nach unten
- gfx.DrawLine(pen, 40, 800, 550, 800); //Unten nach rechts
- gfx.DrawLine(pen, 550, 40, 550, 800); //Rechts nach unten
- gfx.DrawLine(pen, 40, 40, 550, 40); //Oben nach Rechts
- //Footer
- gfx.DrawLine(pen, 40, 710, 550, 710); //Querlinie oben
- gfx.DrawLine(penSmall, 40, 755, 550, 755); //Querlinie Mitte
- gfx.DrawLine(penSmall, 40, 770, 320, 770); //Obere Halbe Querlinie
- gfx.DrawLine(penSmall, 40, 785, 320, 785); //Untere Halbe Querlinie
- gfx.DrawLine(penSmall, 90, 710, 90, 800); //Vertikal Linie Links
- gfx.DrawLine(penSmall, 320, 710, 320, 800); //Vertikal Linie Rechts
- gfx.DrawLine(penSmall, 200, 755, 200, 800); //Vertikal Halbe Linie Mitte
- //Kundendaten
- XRect rectKunde = new XRect(40, 711, 50, 44);
- gfx.DrawRectangle(penSmall, rectKunde);
- tf.DrawString(" Kunde:", fontArial, XBrushes.Black, rectKunde, XStringFormats.TopLeft);
- XRect rectName = new XRect(90, 711, 230, 11);
- gfx.DrawRectangle(penSmall, rectName);
- tf.DrawString(" " + textBox_Panel_Montageadresse_Name.Text, fontArial, XBrushes.Black, rectName, XStringFormats.TopLeft);
- XRect rectName2 = new XRect(90, 722, 230, 11);
- gfx.DrawRectangle(penSmall, rectName2);
- tf.DrawString(" " + textBox_Panel_Montageadresse_Name2.Text, fontArial, XBrushes.Black, rectName2, XStringFormats.TopLeft);
- XRect rectStraße = new XRect(90, 733, 230, 11);
- gfx.DrawRectangle(penSmall, rectStraße);
- tf.DrawString(" " + textBox_Panel_Montageadresse_Strasse.Text, fontArial, XBrushes.Black, rectStraße, XStringFormats.TopLeft);
- XRect rectOrt = new XRect(90, 744, 230, 11);
- gfx.DrawRectangle(penSmall, rectOrt);
- tf.DrawString(" " + textBox_Panel_Montageadresse_Ort.Text, fontArial, XBrushes.Black, rectOrt, XStringFormats.TopLeft);
- //Montagedaten
- XRect rectMontage = new XRect(90, 755, 110, 15);
- gfx.DrawRectangle(penSmall, rectMontage);
- tf.DrawString(" Montage:", fontArial, XBrushes.Black, rectMontage, XStringFormats.TopLeft);
- XRect rectAenderung = new XRect(200, 755, 120, 15);
- gfx.DrawRectangle(penSmall, rectAenderung);
- tf.DrawString(" Änderung:", fontArial, XBrushes.Black, rectAenderung, XStringFormats.TopLeft);
- XRect rectDatum = new XRect(40, 770, 50, 15);
- gfx.DrawRectangle(penSmall, rectDatum);
- tf.DrawString(" Datum:", fontArial, XBrushes.Black, rectDatum, XStringFormats.TopLeft);
- XRect rectTechniker = new XRect(40, 785, 50, 15);
- gfx.DrawRectangle(penSmall, rectTechniker);
- tf.DrawString(" Techniker:", fontArial, XBrushes.Black, rectTechniker, XStringFormats.TopLeft);
- XRect rectDatumText = new XRect(90, 770, 110, 15);
- gfx.DrawRectangle(penSmall, rectDatumText);
- tf.DrawString(" " + textBox_Panel_Montage.Text, fontArial, XBrushes.Black, rectDatumText, XStringFormats.TopLeft);
- XRect rectTechnikerText = new XRect(90, 785, 110, 15);
- gfx.DrawRectangle(penSmall, rectTechnikerText);
- tf.DrawString(" " + textBox_Panel_Techniker.Text, fontArial, XBrushes.Black, rectTechnikerText, XStringFormats.TopLeft);
- //Header
- XImage imageBosch_Logo = XImage.FromGdiPlusImage(Resources.Bosch_Logo);
- XRect rect = new XRect(60, 55, 220, 20);
- gfx.DrawRectangle(XBrushes.White, rect);
- tf.DrawString("Bosch Sicherheitssysteme GmbH", fontÜberschrift, XBrushes.Black, rect, XStringFormats.TopLeft);
- gfx.DrawImage(imageBosch_Logo, 435, 50, 99, 30);
- //Aufbau MAP Modul
- XImage imageMAP5000Modul = XImage.FromGdiPlusImage(Resources.MAP5000Modul);
- gfx.DrawImage(imageMAP5000Modul, 220, 85, 320, 620);
- XRect rect1 = new XRect(60, 156, 158, 55);
- gfx.DrawRectangle(penSmall, rect1);
- tf.DrawString("MAP Data BUS", fontArial, XBrushes.Black, rect1, XStringFormats.TopLeft);
- XRect rect2 = new XRect(60, 213, 158, 33);
- gfx.DrawRectangle(penSmall, rect2);
- tf.DrawString(MAP_Ausgang1, fontArial, XBrushes.Black, rect2, XStringFormats.TopLeft);
- XRect rect3 = new XRect(60, 246, 158, 33);
- gfx.DrawRectangle(penSmall, rect3);
- tf.DrawString(MAP_Ausgang2, fontArial, XBrushes.Black, rect3, XStringFormats.TopLeft);
- XRect rect4 = new XRect(60, 282, 158, 47);
- gfx.DrawRectangle(penSmall, rect4);
- tf.DrawString(MAP_Relais1, fontArial, XBrushes.Black, rect4, XStringFormats.TopLeft);
- XRect rect5 = new XRect(60, 330, 158, 47);
- gfx.DrawRectangle(penSmall, rect5);
- tf.DrawString(MAP_Relais2, fontArial, XBrushes.Black, rect5, XStringFormats.TopLeft);
- XRect rect6 = new XRect(60, 378, 158, 32);
- gfx.DrawRectangle(penSmall, rect6);
- tf.DrawString(MAP_Spannung, fontArial, XBrushes.Black, rect6, XStringFormats.TopLeft);
- XRect rect7 = new XRect(60, 411, 158, 23);
- gfx.DrawRectangle(penSmall, rect7);
- tf.DrawString(MAP_ML1, fontArial, XBrushes.Black, rect7, XStringFormats.TopLeft);
- XRect rect8 = new XRect(60, 435, 158, 23);
- gfx.DrawRectangle(penSmall, rect8);
- tf.DrawString(MAP_ML2, fontArial, XBrushes.Black, rect8, XStringFormats.TopLeft);
- XRect rect9 = new XRect(60, 459, 158, 23);
- gfx.DrawRectangle(penSmall, rect9);
- tf.DrawString(MAP_ML3, fontArial, XBrushes.Black, rect9, XStringFormats.TopLeft);
- XRect rect10 = new XRect(60, 483, 158, 23);
- gfx.DrawRectangle(penSmall, rect10);
- tf.DrawString(MAP_ML4, fontArial, XBrushes.Black, rect10, XStringFormats.TopLeft);
- XRect rect11 = new XRect(60, 507, 158, 23);
- gfx.DrawRectangle(penSmall, rect11);
- tf.DrawString(MAP_ML5, fontArial, XBrushes.Black, rect11, XStringFormats.TopLeft);
- XRect rect12 = new XRect(60, 531, 158, 23);
- gfx.DrawRectangle(penSmall, rect12);
- tf.DrawString(MAP_ML6, fontArial, XBrushes.Black, rect12, XStringFormats.TopLeft);
- XRect rect13 = new XRect(60, 555, 158, 23);
- gfx.DrawRectangle(penSmall, rect13);
- tf.DrawString(MAP_ML7, fontArial, XBrushes.Black, rect13, XStringFormats.TopLeft);
- XRect rect14 = new XRect(60, 579, 158, 23);
- gfx.DrawRectangle(penSmall, rect14);
- tf.DrawString(MAP_ML8, fontArial, XBrushes.Black, rect14, XStringFormats.TopLeft);
- XRect rect15 = new XRect(60, 603, 158, 32);
- gfx.DrawRectangle(penSmall, rect15);
- tf.DrawString(MAP_DK, fontArial, XBrushes.Black, rect15, XStringFormats.TopLeft);
- document.Save(sfd.FileName);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement