Skip to content

Instantly share code, notes, and snippets.

View paul42's full-sized avatar

Paul.42 paul42

View GitHub Profile
@paul42
paul42 / gist:7394803a64a3787d97079781df10696c
Created January 25, 2018 20:52 — forked from halyph/gist:5378331
Calculate PDF Table Row Heights with iTextSharp (link) [http://kuujinbo.info/iTextSharp/rowHeights.aspx]
public static float TotalRowHeights(
Document document, PdfContentByte content,
PdfPTable table, params int[] wantedRows)
{
float height = 0f;
ColumnText ct = new ColumnText(content);
// respect current Document.PageSize
ct.SetSimpleColumn(
document.Left, document.Bottom,
document.Right, document.Top
@paul42
paul42 / Test Pipeline Class
Created January 24, 2018 17:29 — forked from jmichas/Test Pipeline Class
This gist illustrates a TPL Dataflow Pipeline that branches and the various ways to propagate completion and why some work and some don't.
public class DataflowTestPipeline
{
public TransformBlock<Thing, Thing> MainBlock { get; set; }
public TransformBlock<Thing, Thing> Block1 { get; set; }
public TransformBlock<Thing, Thing> Block2 { get; set; }
public TransformBlock<Thing, Thing> Block3 { get; set; }
public ActionBlock<Thing> EndBlock { get; set; }
public void CreatePipelineSynchronousWithLinkOptions()
{