I am using MVC and I have been trying to get Rotativa DC toolbar to display at the top but no luck. It only displays the pop-up menu at the bottom of the page when hover mouse over the bottom page. What is the parameter to force Rotativa to always display
the top Menu? Does anyone know? Below is my code: (btw, I set it to show the Pdf page on a new tab and it works fine except without the top toolbar)
If you want to display something at the top, you could add headers options.
Headers And Footer Options
--footer-center* <text> Centered footer text
--footer-font-name* <name> Set footer font name (default Arial)
--footer-font-size* <size> Set footer font size (default 11)
--footer-html* <url> Adds a html footer
--footer-left* <text> Left aligned footer text
--footer-line* Display line above the footer
--footer-right* <text> Right aligned footer text
--footer-spacing* <real> Spacing between footer and content in mm (default 0)
--header-center* <text> Centered header text
--header-font-name* <name> Set header font name (default Arial)
--header-font-size* <size> Set header font size (default 11)
--header-html* <url> Adds a html header
--header-left* <text> Left aligned header text
--header-line* Display line below the header
--header-right* <text> Right aligned header text
--header-spacing* <real> Spacing between header and content in mm (default 0)
Below code snippet creates pdf with header and footer by using html page, you can refer to it and change it to what you want.
Thank you for your advice. I did try both header and footer but they didn't give me a full blown pdf page with the menu bar at the top. All I got was a little popup black menu when hover the mouse cursor at the bottom of the page. How do I force Rotativa
to display the full menu toolbar at the top with side panels on both left and right of the page?
Bottom line is that I would like to have the top menu bar with left and right panels on the pdf page. Header and footer are not that important to me.
Member
5 Points
62 Posts
Rotativa DC Toolbar
Nov 07, 2017 04:22 PM|monde|LINK
I am using MVC and I have been trying to get Rotativa DC toolbar to display at the top but no luck. It only displays the pop-up menu at the bottom of the page when hover mouse over the bottom page. What is the parameter to force Rotativa to always display the top Menu? Does anyone know? Below is my code: (btw, I set it to show the Pdf page on a new tab and it works fine except without the top toolbar)
string footer = "--footer-center \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"3\" --footer-spacing 5 --footer-font-name \"calibri light\"";
return new PartialViewAsPdf("_GetLabelRecordsPDF", dsTbl)
{
PageSize = Rotativa.Options.Size.A4,
PageOrientation = Rotativa.Options.Orientation.Portrait,
PageMargins = { Top = 0, Bottom = 0 },
PageHeight = 180,
CustomSwitches = footer
};
Participant
990 Points
475 Posts
Re: Rotativa DC Toolbar
Nov 08, 2017 06:41 AM|zxj|LINK
Hi monde,
Based on the code, you just add footer in pdf.
If you want to display something at the top, you could add headers options.
Headers And Footer Options
--footer-center* <text> Centered footer text
--footer-font-name* <name> Set footer font name (default Arial)
--footer-font-size* <size> Set footer font size (default 11)
--footer-html* <url> Adds a html footer
--footer-left* <text> Left aligned footer text
--footer-line* Display line above the footer
--footer-right* <text> Right aligned footer text
--footer-spacing* <real> Spacing between footer and content in mm (default 0)
--header-center* <text> Centered header text
--header-font-name* <name> Set header font name (default Arial)
--header-font-size* <size> Set header font size (default 11)
--header-html* <url> Adds a html header
--header-left* <text> Left aligned header text
--header-line* Display line below the header
--header-right* <text> Right aligned header text
--header-spacing* <real> Spacing between header and content in mm (default 0)
Below code snippet creates pdf with header and footer by using html page, you can refer to it and change it to what you want.
Here is an article about how to manage headers and footers.
Regards,
zxj
Member
5 Points
62 Posts
Re: Rotativa DC Toolbar
Nov 08, 2017 02:14 PM|monde|LINK
Hello zxj,
Thank you for your advice. I did try both header and footer but they didn't give me a full blown pdf page with the menu bar at the top. All I got was a little popup black menu when hover the mouse cursor at the bottom of the page. How do I force Rotativa to display the full menu toolbar at the top with side panels on both left and right of the page?
Bottom line is that I would like to have the top menu bar with left and right panels on the pdf page. Header and footer are not that important to me.
Thank you.