12 Replies Latest reply on Apr 29, 2009 8:15 AM by Patrick Leckey

    Need help for automated import/export of comments in XFDF

    Rosemann85

      Hi !

       

      I created 2 Buttons on my toolbar. One for send comments and one for receive comments! If I click the send button, a window opens and ask for the directory where I want to save the xfdf file.

       

      How can i realize, that I can save the xfdf-file automatic in a folder, which is specified in the javascript file? The same for import!

       

      In web I found:

      cExec: "this.importAnXFDF({bAnnotations: true, cPath: /c/PDFTest/Demo.xfdf});",     and

      cExec: "this.exportAsXFDF({bAnnotations: true, cPath: /c/PDFTest/Demo.xfdf});",

       

      but if click the button...nothing happens. How can I implement this??

       

       

      This is the sourcecode of the created config.js file

       

      var strtest= "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + // 0
      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + // 1
      "FFE4DBD4FF8F9CC8FFD2D3E0FFDBDCD9FFC7E8F9FFC7E8F9FF999FC6FFEEEDEDFFFEFFFFFFB6C8E 7FFB2D0E3FFF8F8F8FFFFFFFFFFC2A47BFFD2BC9EFFD0B898FFEEEDED" + // 2
      "FFB0AFCDFFE7F2FBFFD1D1D0FFE4E4E4FFC3DAE7FFC7E8F9FF7674A5FFB3C9DCFFAAC4E8FF5D8FC 8FFB9D5E6FFD3C9D8FFFEFEFEFFC6AA84FFECE6DFFFFEFDFAFFD2C9C8" + // 3
      "FFC3DAE7FFB2BFCBFFA4B3C9FF9CB8D9FF7199B3FFA4B3C9FF8A8BBBFF9993A9FFAC9DA7FFA5989 2FF769BC4FFC6C2B8FFEEEEEFFFC2A47BFFF5F1ECFFAA8657FFD8D6D6" + // 4
      "FFDAD6E1FFDAD6E1FFCACFD3FF88899AFFB6AAB3FFD8D8D8FFE1E1E1FFE9E9E9FFEEEEEFFFE7E4E 5FF31312DFFDCDCDDFFFCFCFCFFF3F3F3FFCDBCA7FFC6C2B8FFE9E9E9" + // 5
      "FFEEE9E4FFE4E3EBFFE9E9E9FFE1E1E1FF9C966AFFDFDFDFFFD8D6D6FF8E3F43FF99987CFFCFBD6 FFFB7A289FFE9E9E9FFFFFFFFFFFFFFFFFFF8F8F8FFC6C2B8FFE6E6E6" + // 6
      "FFF9F9F9FFFDFDFDFFFEFEFEFFFFFFFFFFF9F9F9FFB0B0A5FFC5AE62FFE8D98FFF512C25FF845A4 3FFD2CC9FFFF3EAB8FFA79D79FF8C8674FFEBE5B6FFD6D7D7FFFBFBFB" + // 7
      "FFFBFBFBFFFEFEFEFFFFFFFFFFFFFFFFFFFDFDFDFFE4E4E4FF9F8940FFBDB689FFCFBD6FFFFBE89 1FFFDF4C0FFCFC384FFF3EAB8FFEBE5B6FFEDD26EFFDDDDDDFFFEFEFE" + // 8
      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C1C3FF616D6BFF6E7B79FF5D676 8FF616665FFDADBDBFFD8D6D6FFD9D9D9FFE6E6E6FFFBFBFBFFFFFFFF" + // 9
      "FFFDFDFDFFF8F8F8FFFFFFFFFFFFFFFFFFFFFFFFFFF6F6F6FF616D6BFF6E7B79FF5B6562FF525A5 8FF616D6BFF6B7574FFFBFBFBFFFDFDFDFFFFFFFFFFFFFFFFFFFFFFFF" + // 10
      "FFF5F5F5FF686C6CFF6E7B79FF6D7877FF6E7B79FF646F6EFF616D6BFF464B47FF969999FF383E3 CFF616D6BFF6B7574FF48504DFFFAFAFAFFFFFFFFFFFFFFFFFFFFFFFF" + // 11
      "FFFFFFFFFFFCFCFCFFECECECFFD5D6D6FFBABCBEFFC0C1C3FFDCDCDDFFEEEEEFFFFAFAFAFFF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FFFFFFFFFFFFFFFFFFFFFFFFFFF"; // 19

       


      var pos = 0;

      var iconStreamObj = {
          read: function readMyIcon(nBytes){
              var t = "";
              console.println("request for " +nBytes);
              while (pos < nBytes){
                  t = t+strtest;
                  pos += strtest.length;
              }
              return t;
          },
          width:17,
          height:20
      }

      // Create a toolbutton using the icon I loaded above
      app.addToolButton
      ({
          cName: "receive comments",
          oIcon: iconStreamObj,
          cExec: "this.importAnXFDF({bAnnotations: true });",

       

          cTooltext: "Press button for receiving comments!",
          nPos: 0
      });

       

      var pos = 0;

      var iconStreamObj = {
          read: function readMyIcon(nBytes){
              var t = "";
              console.println("request for " +nBytes);
              while (pos < nBytes){
                  t = t+strtest;
                  pos += strtest.length;
              }
              return t;
          },
          width:17,
          height:20
      }

      // Create a toolbutton using the icon I loaded above
      app.addToolButton
      ({
          cName: "send comments",
          oIcon: iconStreamObj,
          cExec: "this.exportAsXFDF({bAnnotations: true });",
          cTooltext: "Press button for sending comments!",
          nPos: 0
      });

       

       

      Please help!!  Thanks