Created
February 9, 2015 12:46
-
-
Save cpoDesign/0ebcd1a43934dc00f616 to your computer and use it in GitHub Desktop.
Generating pdf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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