Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Script to Change pdf Background Colour
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Script to Change pdf Background Colour

 Post Reply Post Reply
Author
mhoney View Drop Down
New Member
New Member


Joined: 17 Dec 2013
Location: Australia
Points: 34
Post Options Post Options   Quote mhoney Quote  Post ReplyReply Direct Link To This Post Topic: Script to Change pdf Background Colour
    Posted: 31 Mar 2014 at 9:57am
Hi,

Just chasing some assistance and hoping you might be able to help.  Just need some script to change the background colour of a pdf

this.color = color.blue;

Is this all that is required? Also need to remove the background when needed.

Thanks.


Edited by mhoney - 31 Mar 2014 at 10:03am
Michael.
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 2014 at 10:04am
Cannot be done. There is no access to the graphical elements in a PDF from scripting, and even if there were, there is no such thing as "background colour". There could be a background object with a colour, but again, scripting cannot do this.


Back to Top
mhoney View Drop Down
New Member
New Member


Joined: 17 Dec 2013
Location: Australia
Points: 34
Post Options Post Options   Quote mhoney Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 2014 at 10:20am
Thanks for the advice...I was just asking as you can add a background color to a pdf manually with the pages menu add background from source color.  

So are you saying that this particular feature cannot be automated using script only accessible within the main pdf document user interface itself?

Thanks.
Michael.
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 2014 at 10:24am
Certainly, JavaScript can only do a tiny fraction of the things available in the user interface. Never noticed that option before, but doesn't change anything. (There is still no background colour, so it is doing shorthand for "create a coloured rectangle as background)

Edited by aandi - 31 Mar 2014 at 10:25am
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4111
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 2014 at 3:40pm
It might be possible to add a transparent tex annotation and set the color and transparency for the background color and if you wanted that color to be content of the PDF you would have to flatten the PDF.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.