codaxy / wkhtmltopdf

C# wrapper around excellent wkhtmltopdf console utility.
265 stars 92 forks source link

Change footer/header fonts size #26

Closed SergioReis97 closed 7 years ago

SergioReis97 commented 7 years ago

Any way of changing the footer font size? or just include it as HTML also basicly. Other than that, great so far.

System.IO.Stream stream = new System.IO.MemoryStream();
            PdfConvert.ConvertHtmlToPdf(new PdfDocument {
                Url = "http://wkhtmltopdf.org/",
                HeaderLeft = "[title]",
                HeaderRight = "[date] [time]",
                FooterRight = "Oh noooooooooooooo",
                FooterLeft = "Página [page] I am really long and will eventually collide with the ",

            }, new PdfOutput {
                OutputStream = stream,
            });
            stream.Flush();
            stream.Position = 0;
            return new FileStreamResult(stream, "application/pdf");
mstijak commented 7 years ago

It seems that options for setting up footer font exist: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt

I would gladly take a PR for this.

SergioReis97 commented 7 years ago

Hmm I did this, also looking into the source code helped with actually seeing how the extra parameters can be use. Will try to give a little hand in documentation when I have a little freetime. Thanks

nickkaczmarek commented 5 years ago

this is a good example of how to use a stream and return a file. should be in the documentation.