Scaled Printing

Posted by: mlennox on 13 September 2022, 5:28 am EST

  • Posted 13 September 2022, 5:28 am EST

    Hi,

    We’ve looked through the documentation and demos, but we can’t find any way to scale the spreadsheet to fit more columns/rows into a single printed page. Is there an option somewhere to set the scale, so that when the page is sent to the browser print mechanism is appears smaller so more of the spreadsheet fits on a single page?

    We have also checked PDF exporting, and it behaves the same as printing from what we can see.

    Thanks in advance

  • Posted 13 September 2022, 8:57 pm EST

    Hi,

    For this, you may use PrintInfo and set the zoomFactor(printinfo.zoomFactor method) according to your need. Further, You may also use other methods of PrintInfo class such as startRow endRow, fitPagesTall,fitPagesWide, etc to define the page print area. Please refer to the following doc and Demo link and demonstrates the same.

    Doc: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Print.PrintInfo

    Demo: https://www.grapecity.com/spreadjs/demos/features/pdf/custom-pdf#demo_source_name

    regards,

    Avinash

  • Posted 15 September 2022, 5:19 am EST

    Thanks. This sounds like it would work for us. That demo doesn’t allow you to change any of the parameters you suggested. Is there another demo that allows changing the zoom or fit page parameters?

    Secondly, is there already a UI that allows the user to specify their print parameters so that they can see how the print will look when they change the params?

  • Posted 15 September 2022, 5:11 pm EST

    HI,

    For zoomFactor you refer to the following code snippet. You may also refer to the printInfo class where you can get all the method that you could use.

    
    var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
    printInfo.zoomFactor(2);
    activeSheet.printInfo(printInfo);
    spread.print(0);
    
    

    For showing print features we have Deisgner component which has been implemented using the spreadsJS API. Please refer to the following link;

    Further, if you want to implement a print preview feature you may refer to the following attached sample.

    Designer: https://www.grapecity.com/spreadjs/designer/

    PrintInfo Class: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Print.PrintInfo#zoomfactor

    sjs_print_preview (1).zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels