public void DodajZaglavljeLevo(Kompanija kompanija, PdfPage stranica) { XGraphics gfx = XGraphics.FromPdfPage(stranica); XFont font = new XFont("Times New Roman", 12, XFontStyle.Regular); XTextFormatter tf = new XTextFormatter(gfx); XRect xRect = new XRect(30, 20, 350, 220); tf.Alignment = XParagraphAlignment.Left; tf.DrawString("Naziv kompanije:" + kompanija.Naziv, font, XBrushes.Black, xRect, XStringFormats.TopLeft); xRect = new XRect(30, 35, 350, 220); tf.Alignment = XParagraphAlignment.Left; tf.DrawString("Lokacija kompanije:" + LokacijaHelper(kompanija.Lokacije), font, XBrushes.Black, xRect, XStringFormats.TopLeft); xRect = new XRect(30, 50, 350, 220); tf.Alignment = XParagraphAlignment.Left; tf.DrawString("Kontakti kompanije:" + KontakHelper(kompanija.Kontakti), font, XBrushes.Black, xRect, XStringFormats.TopLeft); gfx.Dispose(); }
public void PostaviInformacije(Kompanija k, PdfPage stranica) { XGraphics gfx = XGraphics.FromPdfPage(stranica); XFont font = new XFont("Times New Roman", 18, XFontStyle.Regular); XFont fontBold = new XFont("Times New Roman", 12, XFontStyle.BoldItalic); XTextFormatter tf = new XTextFormatter(gfx); XRect xRect = new XRect(40, 410, 350, 220); tf.Alignment = XParagraphAlignment.Center; tf.DrawString("Informacije o kompaniji " + k.Naziv, font, XBrushes.Black, xRect, XStringFormats.TopLeft); font = new XFont("Times New Roman", 12, XFontStyle.Regular); xRect = new XRect(60, 450, 350, 220); tf.Alignment = XParagraphAlignment.Left; tf.DrawString("Naziv kompanije: ", fontBold, XBrushes.Black, xRect, XStringFormats.TopLeft); xRect = new XRect(175, 450, 350, 220); tf.DrawString(k.Naziv, font, XBrushes.Black, xRect, XStringFormats.TopLeft); xRect = new XRect(60, 465, 350, 220); tf.Alignment = XParagraphAlignment.Left; tf.DrawString("Adresa kompanije: ", fontBold, XBrushes.Black, xRect, XStringFormats.TopLeft); xRect = new XRect(175, 465, 350, 220); tf.DrawString(HelperClass.Instance.LokacijaHelper(k.Lokacije), font, XBrushes.Black, xRect, XStringFormats.TopLeft); xRect = new XRect(60, 480, 350, 220); tf.Alignment = XParagraphAlignment.Left; tf.DrawString("Kontakti kompanije: ", fontBold, XBrushes.Black, xRect, XStringFormats.TopLeft); int variableHеigh = 480; foreach (Kontakt kontakt in k.Kontakti) { xRect = new XRect(175, variableHеigh, 350, 220); tf.DrawString(HelperClass.Instance.IspisiKontakt(kontakt), font, XBrushes.Black, xRect, XStringFormats.TopLeft); variableHеigh += 15; } gfx.Dispose(); }
public void DodajSlikuUZaglavlje(Kompanija kompanija, PdfPage stranica) { XGraphics gfx = XGraphics.FromPdfPage(stranica); IscrtajSliku(gfx, "wwwroot/images/photo.jpg", 450, 20, 150, 50); gfx.Dispose(); }