Hi there I was using this great library PDF Sharp.now I want to play with some dynamic content that people switch on Migradoc and I did it! Now like the convenience of your paragraphs problem is that when I added a new page so I introduce long paragraphs, instead it is shown incomplete text (unfinished means that text Overflow) and I have an image which Yes, the look down to the footer. How can I do that I can enter dynamic text (variable length) and it only adds the number of pages needed.
My code so far
Xfont font = New XFont ("Times New Roman", 12, XfontSistell.bold); X font fontReg = New X font ("Times New Roman", 12, Xfontcity. Regular); // HACK² gfx.mUH = PdfFontEncoding.Unicode; Gfx.MFEH = PDF Font Embedding Default; String appPath = System.IO.Path.GetDirectoryName (System.Windows.Forms.Application.ExecutablePath); XImage image = Exagger. Gfx.DrawImage (Image, 0, 0); // Civil Stamp gfx.DrawImage (XImage.FromFile (Eppath + "/cStamp.png"), 370, 380); Gfx.DrawImage (XImage.FromFile (Epipath + "/ SPPNG"), 230, 380); CoverPageHeader (); Document document = new document (); MigraDoc.DocumentObjectModel.Section sec = doc.AddSection (); // Add a paragraph with some text and format information. MigraDoc.DocumentObjectModel.Paragraph Para = sec.AddParagraph (); Paramormat.Element = ParagraphElement.LIFT; Para format.font.name = "times new roman"; Para format.font Size = 12; Para format.font.colger = migrodecookie.dadocobjectmodel.colors.black; Parakaddekst ( "We're please review the contract are pleased to present the attached document and, if acceptable, to sign a copy and return to us. We will be signing copies of the agreement and" your "Record) .; para.AddLineBreak (); para.AddLineBreak (); para.AddText (longlongtextString); para.AddLineBreak (); para.AddLineBreak (); para.AddText (the "loyalty,"); MigraDoc.Rendering.DocumentRenderer docRenderer = Introducing the new document-render (doctor); docRenderer.PrepareDocument (); // paragraph Can equally presented tables or shape DocRenderer.RenderObject (gfx, XUnit.FromCentimeter (0.7), XUnit.FromCentimeter (9), "18cm", paragraph); Gfx.DrawString ( "Kelly Trbin PhD., PE Gfx.DrawString ("Project No" + Text Box.Number of Text, FontArg, "SEC", Font, Xbrash Black, 20, 500); Gfx.DrawString ("Principal", Font, XBrash.black, 20, 520) XB.DrawImage (XPath + "/ SkyMagic Page"), 100, 690); Gfx.DrawImage (XImage.FromFile (Appetite + "/ Footer Page"), 220, 750); }
Do not use RenderObject, as instead use RenderDocument and automatically pages Will be made from
Sample code here:
Comments
Post a Comment