Created
December 3, 2012 15:37
-
-
Save manuelnelson/4195776 to your computer and use it in GitHub Desktop.
Pechkin set content spacing
This file contains 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
public ActionResult PrintForm(string html) | |
{ | |
var globalConfig = new GlobalConfig(); | |
globalConfig.SetPaperSize(PaperKind.Letter); | |
var margins = new Margins(100, 100, 100, 100); | |
globalConfig.SetMargins(margins); | |
var synchronizedPechkin = new SynchronizedPechkin(globalConfig); | |
var config = new ObjectConfig(); | |
config.SetAllowLocalContent(true) | |
.SetPrintBackground(true); | |
config.Header.SetFont(new Font("Times New Roman", 9F, FontStyle.Underline)); | |
//The following line has no effect! | |
config.Header.SetContentSpacing(20.0); | |
config.Header.SetLeftText("Left Header text"); | |
config.Header.SetRightText("Right Header Text"); | |
config.Footer.SetFont(new Font("Times New Roman", 12F, FontStyle.Regular)); | |
config.Footer.SetTexts("Footer text", @"[page] of [topage]", "Right footer text"); | |
var pdfBuf = synchronizedPechkin.Convert(config, html); | |
return File(pdfBuf, "application/pdf", "form.pdf"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment