Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: Dmitry on February 09, 2009, 06:38:54 PM

Title: Batch Converter (PNG to VSS)
Post by: Dmitry on February 09, 2009, 06:38:54 PM
Hi,
I'm looking for batch conversion utility to create single vss file from many graphics files (e.g png). Has anyone can recommend such software?
Thanx.
Title: Re: Batch Converter (PNG to VSS)
Post by: Dmitry on February 11, 2009, 10:54:33 PM
Haven't found anything, so ... have done it - if anyone is interested, download the attached file and feel free to use.
You'll be able:
- convert hundreds of graphics files into single Visio stencil file;
- create connection points (as many as you want).
Unzip & install, note it requires Visio 2003 or 2007 and NET Framework 3.5.
Title: Re: Batch Converter (PNG to VSS)
Post by: Dmitry on February 18, 2009, 12:46:13 PM
After reading this: Create Clean & Tidy Visio Shapes Using Images With Transparent Backgrounds (http://www.visguy.com/2009/02/17/clean-and-tidy-shapes-with-png-images/), I've made improved version, now with automatic cropping and making transparent backgrounds. Still the same requirements.
Title: Re: Batch Converter (PNG to VSS)
Post by: Visio Guy on February 18, 2009, 02:27:17 PM
Wow, thanks Dmitry, very impressive!
Title: Re: Batch Converter (PNG to VSS)
Post by: Dmitry on March 04, 2009, 10:48:34 PM
Even better one, with improvements: more connection points, better transparency etc...
Title: Re: Batch Converter (PNG to VSS)
Post by: y0gurt on July 02, 2009, 02:16:32 PM
OK Dmitry, This Rocks! Thanks!
Title: Re: Batch Converter (PNG to VSS)
Post by: nikos_ps on July 25, 2010, 07:47:28 AM
Dimitri you rock!!!!!!

thanks very much for the app...  :)
Title: Re: Batch Converter (PNG to VSS)
Post by: JuneTheSecond on July 26, 2010, 07:15:12 AM
Cool and wonderful!
I was wasting time with various tools to remove background!
Now it is almost automatic!
Thank you, Dimitri!
Title: Re: Batch Converter (PNG to VSS)
Post by: ged325 on November 18, 2010, 04:37:32 PM
Any chance of this being done the other way as well?  Need to go from VSS to PNG.
Title: Re: Batch Converter (PNG to VSS)
Post by: Paul Herber on November 18, 2010, 09:37:31 PM
This can be done quite easily in VBA.


with empty page
for each shape in stencil {
  drop shape on page
  select all
  save as <shape.name>.png
  delete shape
}

Title: Re: Batch Converter (PNG to VSS)
Post by: ged325 on November 19, 2010, 03:43:11 AM
After some research I ended up using the interop in .Net, thanks for the reply.
Title: Re: Batch Converter (PNG to VSS)
Post by: sunflower on December 13, 2011, 10:34:44 AM
Hi,

Is there any means by which we can convert the imgaes to vdx file ????? i.e an *.jpg file to *.vdx file where we can have all the processes that are there in image mapped to vdx.

Title: Re: Batch Converter (PNG to VSS)
Post by: aledlund on December 13, 2011, 03:03:55 PM
once your stencil has been made (.vss), save as .VSX (which is the xml version of a stencil).
al
Title: Dimitry! Are you still here?
Post by: markem on October 28, 2018, 05:04:07 AM
Hey! I hope you read this. I have been using your PNG2VSS program for a while. It is utterly fantastic. My problem is - I have thousands of files to load in to VSS files. So your program helps - but I need to be able to run it at the command level. I.E.: c:>png2vss <Directory to convert>.

Is this possible? Hopefully you will see and respond to this post.  Thanks if you do in advance!

By the way - if you have the source code still and do not want to work on this - let me have the source code and I'll work on it myself and give you back the code. :-)
Title: Re: Batch Converter (PNG to VSS)
Post by: Dmitry on October 28, 2018, 10:10:42 AM
What you're asking for is already implemented. Look into manual, section 3.8.
The latest version is 5.4:
https://drive.google.com/file/d/1tR34z64zveZLo_nPxhL9wbdLJSiPPcmO/view?usp=sharing (https://drive.google.com/file/d/1tR34z64zveZLo_nPxhL9wbdLJSiPPcmO/view?usp=sharing)
Title: Re: Batch Converter (PNG to VSS)
Post by: markem on October 29, 2018, 03:04:41 PM
First - a BIG THANK YOU to Dimitry! :-)

I had version 5.0 - this is version 5.4. Thanks again!

Now my findings:

There are problems with png2vss. These are not major problems or anything like that - more of a "Gotcha!" kind of problems with it. I'm posting these here to maybe help someone else who comes along after I am gone.

1. Directory structure. Under Windows 98se - Microsoft switched how a pathname could be separated. It used to be it had to be a backslash (\). Starting under Windows 98se Microsoft made it so you could use the blackslash or a forwards slash (/). I was trying to write a batch script and tying "/" is a lot easier than "\". Further, I was using PHP to write the script. So since PHP thinks a "\" means the next character is escaped (like a new line is "\n") - it stands to reason to use the "/". Anyway, IF YOU USE IT then png2vss will not work correctly. For some reason VB seems to think it is some kind of shortcut to some other location. In my case it sent the output to "C:/Windows/System32" directory. To be truthful - I have no idea why it really does this but it has to be something in VB.

2. There are two options "/F" and "/O". "/F" is for the files to read and insert into the library you are creating and "/O" is for the output. The output one has more problems. If you just run the program and then click to set the output file - the program will - if you leave it off - add a ".vss" to the name of the file. Batch life is different. Batch life YOU have to put the ".vss" onto the file. Otherwise - you wind up with an unknown file type. This isn't a biggie - just remember to always put the ".vss" onto the output file name and you will be ok.

3. The "/S" option. This option tells png2vss to run automatically. I would have thought it always would - but then that's just me. Now - here is the problem though. The program will not automatically close once it is through. You see - there is a check box for that. So BEFORE you start a batch job - bring up png2vss and check the "Close When Done" checkbox.

4. Batch files don't really work. What I mean is - I have about 2,000 image files that I wrote a PHP script to break up into chunks of 36 images each. (Yeah - lot of files there!) This program wrote out a batch script called t.bat. Imagine my surprise when I run t.bat and it runs the first command, finishes, and then .....dies. Yes. Kicked it right out of the batch script. So I'm like "Ok - I'll try it again". Dies. Take out that first command and run it again. Dies. I am not certain why it does this - it just does. My solution was to instead issue a separate SYSTEM command in PHP and send the command to it. It then dies, returns to the PHP script, which then continues to the next file. Again - no idea why it does this. Probably something to do with VB doing some kind of clearing of everything when it exits.

5. More options. Yes! Lots more options would be great! Here is a partial list:

5.1 "/C". Close When Done
5.2 "/US" Update Stencil
5.3 "/OS" Open Stencil
5.4 "/ST" Show Tooltips
and many more.... Basically, it would be nice to be able to do any of the options the program has from the command line.

So overall - this is an absolutely fantastic program! Just keep these things in mind when using them and I am really hoping Dimitry, if nothing else, puts in the extra options. Especially the "/C" option.

That's it! Have fun!
Title: Re: Batch Converter (PNG to VSS)
Post by: chrisnasah on June 02, 2021, 03:20:02 PM
anyone know where i download this from?
Title: Re: Batch Converter (PNG to VSS)
Post by: Nikolay on June 02, 2021, 06:36:12 PM
Aren't the links on the first page working?

The author's LinkedIn seems to be (but not sure):
https://www.linkedin.com/in/dmitryivanov/

You could try pinging the author maybe?

BTW the app is .NET, and it's tiny, decompiling it with dotPeek or ILSpy for example is like 5 minutes (http://rsdn.org/Forum/Images/shuffle.gif)
You may need to ask permission from the author before doing so though as it seems he did not specify any license terms.
Title: Re: Batch Converter (PNG to VSS)
Post by: wapperdude on June 02, 2021, 10:54:46 PM
Aren't there zip files attached???  Should have everything needed.  I haven't tried it as the need never arose.

Edit:  OK.  The zip files do not have the latest version.  Guess I should've verified first.
Title: Re: Batch Converter (PNG to VSS)
Post by: chrisnasah on June 03, 2021, 09:18:06 AM
Hello,

Dmitry kindly emailed me the new link so sharing as below.

https://drive.google.com/file/d/16j_bDC8VFxph-Mqh1l_eFKg1YuYyAvQi/view?usp=sharing (https://drive.google.com/file/d/16j_bDC8VFxph-Mqh1l_eFKg1YuYyAvQi/view?usp=sharing)