Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

printing with javascript prints too large

New Here ,
Jul 27, 2017 Jul 27, 2017

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

TOPICS
Acrobat SDK and JavaScript
548
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2017 Jul 28, 2017

Can you post your code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 28, 2017 Jul 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();

   

}

);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2017 Jul 28, 2017

I guess you should use the bShrinkToFit parameter.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 28, 2017 Jul 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2017 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 28, 2017 Jul 28, 2017
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines