Skip navigation
e_leska
Currently Being Moderated

Does Reader support saveas conversion to tiff?

Apr 3, 2012 10:45 AM

Tags: #javascript #reader #conversion #tiff

Hello,

 

I am working on a form that has javascript to save the document as TIFF images.  The scripting works fine in both Adobe Standard and Pro.  However, when the document is saved as "Reader Extended PDF" in pro then opened in Reader X, the file conversion run by the submit button fails. 

 

I have read that Adobe Reader X had issues where it only supported save functions to temp or appdata folders, but an update (10.1?) was supposed to address this issue.

 

The code in the folder level js file is:

 

---------------------------------------------------

 

mySaveAs = app.trustPropagatorFunction(function(doc, path)

{

     app.beginPriv();

        doc.saveAs(path, "com.adobe.acrobat.tiff");

     app.endPriv();

});

 

myTrustedSpecialTaskFunc = app.trustedFunction(function(doc, file_path)
{
     // Privileged and/or non-privileged code above
     app.beginPriv();
try{
          mySaveAs(doc, file_path);
app.alert("Thank You - File Has Been Saved And Will Print Next",3);
}catch(e){
app.alert("Could Not Save File - Please Contact Administrator");
}
this.print({bUI: false, nStart:1, nEnd:1, bSilent: true, bShrinkToFit: true});
this.closeDoc(true);
app.openDoc("/C/waivers/myfile.pdf");

     app.endPriv();
});

 

------------------------------------------------

 

Code under button is:

 

// Get the field value
var fn = this.getField("PrintedFullName").valueAsString;

// Specify the folder
var fldr = "/c/waivers/";

// Determine the full path
var file_path = fldr + fn + "_" + myDateString() + ".tiff";

// Save the file
myTrustedSpecialTaskFunc(this,file_path);

 

------------------------------------------------

 

On clicking the submit button, I get the error in the app.alert above "Could Not Save File" in ReaderX, however it works perfectly in Standard or Pro.

 

Any suggestions would be greatly appreciated....this is the last hurdle before we can call this completed!  Thanks!

 
Replies
  • Currently Being Moderated
    Apr 3, 2012 12:39 PM   in reply to e_leska

    The file must have save usage rights for this to work in Reader. Also, you

    have to make sure the conversion ID you're specifying does indeed exist in

    Reader (app.fromPDFConverters will return that list).

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 1:11 PM   in reply to e_leska

    Isn't this what saving as "Reader Extended PDF -> Enable Additional Features " does in Acrobat X Pro?

    Correct.

     

     

    Can you give me an example of how to use that in Reader X to find that out?  If TIFF conversion is not available, is this some type of plug-in that gets added to reader or is it simply not available?

    Just execute that code from the JS console. If TIFF conversion is not available, then you're out of luck.
    It might be possible to develop a Reader plugin that does that, but you'll need to ask in the Acrobat SDK forum about that.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 1:32 PM   in reply to e_leska

    If you can't save the file as TIFF using the menus, then you probably can't

    do it with a script, either.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points