Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
9 replies Latest Post - ‏2011-12-06T18:17:53Z by aryan_raj
aryan_raj
aryan_raj
67 Posts
ACCEPTED ANSWER

Pinned topic PDF generation

‏2011-11-16T12:02:48Z |
Hi All,

I am new to wpf, I need to generate pdf dynamically, I am planning to have a LJO which will contain the code to generate pdf, how to write a pdf to the output stream.
Please suggest.
Updated on 2011-12-06T18:17:53Z at 2011-12-06T18:17:53Z by aryan_raj
  • SystemAdmin
    SystemAdmin
    1493 Posts
    ACCEPTED ANSWER

    Re: PDF generation

    ‏2011-11-16T12:17:30Z  in response to aryan_raj
    Hi,

    I would start by looking at the The Content Launch Action builder. You will want to take a close look at the help pages for this builder.

    Tom
    • aryan_raj
      aryan_raj
      67 Posts
      ACCEPTED ANSWER

      Re: PDF generation

      ‏2011-11-18T02:45:54Z  in response to SystemAdmin
      Hi Tom,

      Thank you for the quick reply, will check.
      • aryan_raj
        aryan_raj
        67 Posts
        ACCEPTED ANSWER

        Re: PDF generation

        ‏2011-11-19T15:17:22Z  in response to aryan_raj
        Hi Tom,

        Can you please provide a sample, or any tutorial link. There are different inputs for "Content Launch Action builder" like Content Load Action, Content Response Description, I am not sure about these inputs.
        • SystemAdmin
          SystemAdmin
          1493 Posts
          ACCEPTED ANSWER

          Re: PDF generation

          ‏2011-11-20T15:27:49Z  in response to aryan_raj
          Here is a wiki article that uses the Content Launch Action builder.

          http://www-10.lotus.com/ldd/pfwiki.nsf/dx/Handling_file_attachments_using_IBM_WebSphere_Portlet_Factory

          Tom
          • aryan_raj
            aryan_raj
            67 Posts
            ACCEPTED ANSWER

            Re: PDF generation

            ‏2011-11-22T16:20:54Z  in response to SystemAdmin
            Hi Tom,

            Thank you, really helpful. One more question, Can I modify/customize the pop-up window's size that is generated by the builder. I can see the below code that is getting used to generate the pop-up,

            <input name="namedTag" value="Pop" onclick="window.open(&quot;<%= JSPSupport.getActionURL(webAppAccess, webAppAccess.getBackchannelURLMapper(false), "fileGiver.provideMyFile") %>", "_blank")" type="button" class="wpfBlueButton">
            • aryan_raj
              aryan_raj
              67 Posts
              ACCEPTED ANSWER

              Re: PDF generation

              ‏2011-12-06T10:31:17Z  in response to aryan_raj
              Can somebody suggest me about how to achieve this.
            • mburati
              mburati
              425 Posts
              ACCEPTED ANSWER

              Re: PDF generation

              ‏2011-12-06T14:20:34Z  in response to aryan_raj
              I don't know of a way to add any args to what is generated in that onclick handler.

              Unless Zag respodds with some way to do it that I'm just not thinking of, then one option you could try is using an Attribute Setter on that namedTag to set (choose the "overwrite existing attributes" option) the onclick attribute with what you see generated there, plus the argument(s) you want to add for specifying the window size). I believe Attribute Setter runs in a late enough generation phase, that it should be able to overwrite that onclick attribute.

              If Attribute Setter doesn't work, then a less elegant workaround may be to use a Visibility Setter to hide that generated namedTag input button and add your own button that does the equivalent, but with the extra window.open arg(s) you need.

              I hope that helps,
              ..mb1
              • SystemAdmin
                SystemAdmin
                1493 Posts
                ACCEPTED ANSWER

                Re: PDF generation

                ‏2011-12-06T16:05:35Z  in response to mburati
                I don't have any tricks for that. I'm a tiny bit uncomfortable with rewriting what the builder creates, because it makes for a potential error in the future. However, it's probably safe -- I can't see much chance of that code ever changing.)

                One other thing that might possibly work (I'm not sure), and probably isn't worth the trouble, is to set that button to have a style of display:none and make another button which calls the onclick of that button and then sets the size of the window. That would keep you safe from future changes to the code which makes that button. But I wouldn't bother, personally.