Rotativa icon indicating copy to clipboard operation
Rotativa copied to clipboard

Create PDF document without the navigation pane

Open rfsoto opened this issue 9 years ago • 1 comments

I love your library, thank you! I am using Rotativa v1.6.4 to create a PDF document based on a Razor view:

return new ViewAsPdf("GetPrintableBennies", bennies) { PageSize = Size.Letter, PageMargins = { Left = 0, Right = 0, Top = 0, Bottom = 0 } };

I display the resulting PDF embedded in a browser. My problem is that the navigation pane on the left side of the document is always open (bookmarks, search, comments...). This navigation pane is irrelevant in a one-page document and takes up too much space! My research tells me that whether the navigation pane is initially opened or closed is determined by the document. My question is: how can I generate the PDF document with the navigation pane closed? Any assistance would be greatly appreciated. -RS

rfsoto avatar Sep 11 '16 12:09 rfsoto

setup a @print Style sheet. that hides any unwanted elements on the page. then pass " --print-media-type " as part of your CustomSwitches.

martic avatar Nov 02 '16 07:11 martic