png export: selecting layers from command line

Hi,
Is it possible to set layer visibility on the command line for the purpose of png export from the command line? Say I have a multi-lingual document, where I have language layers. When I export to png (or print), I only want to see one language at a time on the final picture. Can this be done on command line along with -e?
If not, please point me to the relevant source code, *maybe* I can help...
Thanks! Martin (verif_guy)

On 1/16/06, Martin d Anjou <point14@...1487...> wrote:
Hi,
Is it possible to set layer visibility on the command line for the purpose of png export from the command line? Say I have a multi-lingual document, where I have language layers. When I export to png (or print), I only want to see one language at a time on the final picture. Can this be done on command line along with -e?
Yes, if you know the id of the layer you want to show. See --export-id and --export-id-only in 'man inkscape'.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org

With the precious help of ACSpike, I was able to navigate inkscape source code, but I need more specific help to be able to pull something off:
1) How do I loop around the list of layers and set the visibility to style="display:inline" or style="display:none" based on a command line argument?
2) What is the correct way to add a command line argument that would look like this:
--layers=name1,name2,name3,... (one or more layer names)
Thank you, Martin
On Mon, 16 Jan 2006, Martin d Anjou wrote:
Hi,
Is it possible to set layer visibility on the command line for the purpose of png export from the command line? Say I have a multi-lingual document, where I have language layers. When I export to png (or print), I only want to see one language at a time on the final picture. Can this be done on command line along with -e?
If not, please point me to the relevant source code, *maybe* I can help...
Thanks! Martin (verif_guy)

On 1/16/06, Martin d Anjou <point14@...1487...> wrote:
What is the correct way to add a command line argument that would look like this:
--layers=name1,name2,name3,... (one or more layer names)
As I wrote you in another email, you don't need to do that, we already have --export-id and --export-id-only, which are better because they do not imply just layers, but are applicable to any objects. However you are right that --export-id may be improved if we make it accept a list of ids, not just one id. It should be relatively easy to modify it in that way, and we would gladly accept such a patch.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org

On Mon, Jan 16, 2006 at 10:24:36PM -0500, Martin d Anjou wrote:
With the precious help of ACSpike, I was able to navigate inkscape source code, but I need more specific help to be able to pull something off:
How do I loop around the list of layers and set the visibility to style="display:inline" or style="display:none" based on a command line argument?
What is the correct way to add a command line argument that would look like this:
--layers=name1,name2,name3,... (one or more layer names)
The docs for popt are online here: http://www.rpm.org/dark_corners/popt/
You should be able to slot in your new option into the poptOption structure in main.cpp, and then include code in sp_common_main to break up the comma separated names into individual elements. If you can, code it in a way that'd allow other folks to easily add new multi-item parameters too.
Bryce
participants (3)
-
Bryce Harrington
-
bulia byak
-
Martin d Anjou