Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Adding Export to PDF button to Print Preview pane

    I'm trying to extend the Print Window to show an Export to PDF button. This is what I've got so far but the pdf is blank. Can you provide any guidance on what I should pass to exportContent because getPrintCanvas doesn't seem to be working.


    Code:
    isc.PrintWindow.addProperties({
    
        headerControls: ["headerIcon", "headerLabel","exportButton", "printButton", "closeButton"],
        exportButtonDefaults : {
            _constructor: "IButton",
            title: LABEL_EXPORT,
            icon:"pdficon_small.png",
            height: 20,
            click: "this.creator.exportClicked()"
        },
        exportClicked : function () {
            var pc = this.getPrintCanvas();
            if (!pc) return;
            
            var settings = {skinName: "Graphite", pdfName: "summary" };
            isc.RPCManager.exportContent(pc,settings)
        }
    });

    #2
    It's not clear what you're up to here, but, you pass what you want printed. For some reason you seem to be passing the print preview window itself? You don't want to print a window, presumably.

    Comment


      #3
      Hi, I was passing the print preview window because I couldn't figure out how to access the iframe contents of the window. So, I changed my logic to set a global reference to the contents I pass to the print window. Then, reference that global when generating a pdf. I think providing an "Export to PDF" option as a standard button on the print preview screen is something that would be valuable in the core product, however.

      Comment


        #4
        Interesting suggestion, but we think it's better to expose the PDF export directly to users (with a dedicated button or menu item in the application UI) rather than having them find it in dialog that appears when attempting to print.

        Comment


          #5
          Exposing it elsewhere doesn't mean there isn't value in including a button like this as well, right? But, that's your call. Just a suggestion that seems like a low-effort value add.

          Comment

          Working...
          X