Skip to main content
doobeedoobee
Known Participant
July 28, 2017
Question

printing with javascript prints too large

  • July 28, 2017
  • 5 replies
  • 589 views

I have a javascript script that prints a few PDFs. They are printing about 10% too large. If I print each one manually, they print normal size.

I am using a folder level script and using printparams to adjust the settings. I have tried setting pagehandling to "fit" and "shrink" but it is still larger than it is supposed to be.

Any suggestions?

Thanks

This topic has been closed for replies.

5 replies

doobeedoobee
Known Participant
July 29, 2017

Thanks. I'll give it a go. Interestingly, if I print from the printer tray set up for black and white, it works. It's the colour printing that is a problem

doobeedoobee
Known Participant
July 28, 2017

I've tried

        pp.pageHandling=pp.constants.handling.none;

        pp.pageHandling=pp.constants.handling.fit;

        pp.pageHandling=pp.constants.handling.shrink;

"none" is a lot bigger

"fit" and "shrink" are about 10% too big

try67
Community Expert
Community Expert
July 28, 2017

Maybe try using the tileScale property to scale down your pages... Not sure it will work, but it's the only option I can think of, short of scaling the pages themselves.

JR Boulay
Community Expert
Community Expert
July 28, 2017

I guess you should use the bShrinkToFit parameter.

Acrobate du PDF, InDesigner et Photoshopographe
doobeedoobee
Known Participant
July 28, 2017

var customSilentPrint=app.trustedFunction(

    function(oDoc)

{

    app.beginPriv();

   

    try{

        var pp=oDoc.getPrintParams();

       

        pp.interactive=pp.constants.interactionLevel.silent;

        pp.pageHandling=pp.constants.handling.none; //print actual size, not to fit or shrink

        pp.DuplexType = pp.constants.duplexTypes.DuplexFlipShortEdge;//print double sided

    }

    catch(err){

        app.alert("Error setting up printing parameters.\n\n"+err);

    }

   

    try{

        oDoc.print(pp);

    }

    catch(err){

        app.alert("Error Printing\n\n"+err);

    }

   

    app.endPriv();

   

}

);

try67
Community Expert
Community Expert
July 28, 2017

Can you post your code?