Skip to content

Instantly share code, notes, and snippets.

@cpoDesign
Created February 9, 2015 12:46
Show Gist options
  • Select an option

  • Save cpoDesign/0ebcd1a43934dc00f616 to your computer and use it in GitHub Desktop.

Select an option

Save cpoDesign/0ebcd1a43934dc00f616 to your computer and use it in GitHub Desktop.
Generating pdf
using (var pdfDoc = new Pdf().GetPdfDoc())
{
pdfDoc.Color.String = "255 0 0";
pdfDoc.Rect.String = pdfDoc.MediaBox.String = "A4";
pdfDoc.HtmlOptions.UseScript = false; // set to true if your layout is JavaScript dependent
pdfDoc.Page = pdfDoc.AddPage();
pdfDoc.Color.String = "255 0 0";
int theID;
theID = pdfDoc.AddImageUrl(url);
while (true)
{
////pdfDoc.FrameRect(); // add a black border
if (!pdfDoc.Chainable(theID))
{
break;
}
pdfDoc.Width = 0;
pdfDoc.Page = pdfDoc.AddPage();
pdfDoc.Color.String = "255 0 0";
theID = pdfDoc.AddImageToChain(theID);
}
for (int i = 1; i <= pdfDoc.PageCount; i++)
{
pdfDoc.PageNumber = i;
pdfDoc.Flatten();
}
return StorePdfInWorkArea(pdfDoc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment