private void Doc_LayoutComplete(object sender, PDFLayoutEventArgs args) { var layoutPg = args.Context.DocumentLayout.AllPages[0]; var layoutLine1 = layoutPg.ContentBlock.Columns[0].Contents[0] as Scryber.Layout.PDFLayoutLine; Assert.IsNotNull(layoutLine1); Assert.AreEqual(1, layoutLine1.Runs.Count); var compRun1 = layoutLine1.Runs[0] as Scryber.Layout.PDFLayoutComponentRun; Assert.IsNotNull(compRun1); Assert.IsNotNull(compRun1.Owner); Assert.AreEqual("LoadedImage1", compRun1.Owner.ID); layoutPg = args.Context.DocumentLayout.AllPages[1]; var layoutLine2 = layoutPg.ContentBlock.Columns[0].Contents[0] as Scryber.Layout.PDFLayoutLine; Assert.IsNotNull(layoutLine2); Assert.AreEqual(1, layoutLine2.Runs.Count); var compRun2 = layoutLine2.Runs[0] as Scryber.Layout.PDFLayoutComponentRun; Assert.IsNotNull(compRun2); Assert.IsNotNull(compRun2.Owner); Assert.AreEqual("LoadedImage2", compRun2.Owner.ID); }
private void DefaultFont_LayoutComplete(object sender, PDFLayoutEventArgs args) { //Default font is Sans-Serif var doc = args.Context.DocumentLayout.DocumentComponent; var rsrc = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Sans-Serif"); Assert.IsNotNull(rsrc); }
public void ParagraphPreLayout(object sender, PDFLayoutEventArgs args) { (sender as HTMLParagraph).Contents.Add(new Label() { Text = "We are laying out", StyleClass = "block" }); args.Context.TraceLog.Add(TraceLevel.Message, "Custom Code", "Laying-out the paragraph"); }
public void ParagraphPostLayout(object sender, PDFLayoutEventArgs args) { //This label will not appear as we have finished using the components (sender as HTMLParagraph).Contents.Add(new Label() { Text = "We have been laid out", StyleClass = "block" }); args.Context.TraceLog.Add(TraceLevel.Message, "Custom Code", "Laid-out the paragraph"); }
private void Doc_LayoutComplete(object sender, PDFLayoutEventArgs args) { var pg = args.Context.DocumentLayout.AllPages[0]; var reg = pg.ContentBlock.Columns[0]; var line = reg.Contents[0] as PDFLayoutLine; var runs = line.Runs; var offset = line.BaseLineOffset; //BeginText, TextRun, EndText, Line var path = runs[3] as PDFLayoutComponentRun; }
private void SelectorFont_LayoutComplete(object sender, PDFLayoutEventArgs args) { //Default font is Sans-Serif var doc = args.Context.DocumentLayout.DocumentComponent; var sans = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Arial") as Scryber.Resources.PDFFontResource; if (null == sans) //Arial might not be present and if not then should fall back to the sans-serif { sans = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "sans-serif") as Scryber.Resources.PDFFontResource; } var serif = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "serif") as Scryber.Resources.PDFFontResource; Assert.IsNotNull(sans, "Sans-Serif is null"); Assert.IsNotNull(serif, "Serif is null"); }
private void StandardFont_LayoutComplete(object sender, PDFLayoutEventArgs args) { //Default font is Sans-Serif var doc = args.Context.DocumentLayout.DocumentComponent; var hel = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Helvetica") as Scryber.Resources.PDFFontResource; var times = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Times") as Scryber.Resources.PDFFontResource; var cour = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Courier") as Scryber.Resources.PDFFontResource; var zapf = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Zapf Dingbats") as Scryber.Resources.PDFFontResource; var sym = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Symbol") as Scryber.Resources.PDFFontResource; var timesB = doc.SharedResources.GetResource(Scryber.Resources.PDFResource.FontDefnResourceType, "Times,Bold") as Scryber.Resources.PDFFontResource; Assert.IsNotNull(hel, "Helvetica is null"); Assert.IsNotNull(times, "Times is null"); Assert.IsNotNull(cour, "Courier is null"); Assert.IsNotNull(zapf, "Zapf is null"); Assert.IsNotNull(sym, "Symbol is null"); Assert.IsNotNull(timesB, "Times Bold is null"); }
private void Doc_LayoutComplete(object sender, PDFLayoutEventArgs args) { layout = args.Context.DocumentLayout; }
private void Doc_LayoutComplete(object sender, PDFLayoutEventArgs args) { }
private void SimpleDocumentParsing_Layout(object sender, PDFLayoutEventArgs args) { _layoutcontext = args.Context; }
public void HandlePagePostLayout(object sender, PDFLayoutEventArgs args) { Assert.IsNotNull(args.Context); Invoked.Add("post-layout"); }
public void DocumentPostLayout(object sender, PDFLayoutEventArgs args) { Results.Add("Controller Document Laid out"); }