Announcement

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

    Printing custom content in PDF export

    1. v9.1p_2014-08-24/Pro Deployment

    2. Chrome 40

    We are having an issue with using isc.RPCManager.exportContent() to generate a pdf file available to the user. Basically our dilemma is that when (previously) using showPrintPreview() we were using our own custom printFrame.html that among many things provides some additional css, defines the skin to use and defines other custom content. This works when using showPrintPreview(). Unfortunately when trying to use exportContent() using the same Canvas object, printFrame is not used and we lose all of our custom css. I'm assuming printFrame is only used with showPrintPreview. Is there a way to get this bootstrapped filed to be used with pdf exportContent()? Or is there a similar approach to be used for exportContent()?

    For exportContent I was able to successfully use my own custom skin by defining the css in server.properties. This rendered my pdf with the correct css but I would still rather use something similar to the printFrame.html approach if at all possible. Thank you
    Last edited by tcelikel; 23 Jan 2015, 17:28.

    #2
    See the docs for exportContent() - it explains how to use a custom skin or inject some an additional stylesheet or raw CSS text for export.

    Comment


      #3
      Just found this post - I'm also having problems getting the generated PDF to apply styles. The documentation for exportContent() is severely lacking in detail. It doesn't provide any examples, and doesn't list what the requestProperties can be. I tried inserting an exportCSS property in there, but it doesn't work.

      Code:
      var settings = {
                         skinName: "Enterprise", 
                         exportCSS: ".AI {color: #ff0000;}",
                         pdfName: "Survey" + "_" + that.surveyDefId // without .pdf
                     };
                     isc.RPCManager.exportContent(that.view, settings);

      Comment


        #4
        The requestProperties argument is a DSRequest object, and you should be able to use the DSRequest.exportCSS setting to inject custom CSS into the request as documented here.
        If this feature isn't working for you, that would seem to be a bug. If you can show us a way to reproduce this we'll be happy to take a look.
        Probably the easiest way to do this would be to create a simple canvas to export whose content relies on some css being defined and run exportContent, passing in the required CSS as part of the exportCSS parameter. If this doesn't work for you, show us the (runnable) test case and we'll take a look on our end.
        Please also let us know which version of SmartClient you're running when you encounter this problem (and ensure you've tested with the latest nightly build on that branch)

        Thanks
        Isomorphic Software

        Comment

        Working...
        X