Useless APIs – DWF Watermarks


Just because it’s in the Vault API, doesn’t mean you will be able to build anything cool with it.  There is plenty of stuff in there that is so specific to Vault Explorer or so difficult to use that it’s basically useless to you as an outside developer.  I’m feeling that this will probably be an entire series of articles… especially when I get to the Package Service.

So why am I bothering to write an article about something you can’t use?  Because it’s good to know what you can’t do upfront.  That way you don’t waste precious time on the impossible.  GI Joe cartoons taught me that “Knowing is half the battle.”  Well, following that logic, not-knowing is the other half.  So let’s get started!!


Vault Professional has a cool feature where you can put a watermark on your DWF files.  As a developer, you may be thinking that you can make use of this.  Maybe you want to download these watermarked files or view them in you own app.

No.  Sorry.  You can’t do that.

Although the Vault Server keeps track of the watermark settings, it only includes things like color, text, and location.  The server doesn’t actually generate a file with the watermark on it.  The watermark is rendered client-side.  It’s basically another layer drawn on top of the existing content in the DWF viewer. 

Vault Explorer uses a special DWF viewer that is compiled just for Vault.  And it doesn’t have an API.  Basically, the watermark functions in the Vault API are specifically for the out-of-the-box Vault clients and no one else.


Useless functions:

All of these functions are in the Item Service.

  • GetAllWatermarks
  • GetEnableWatermarking
  • SetEnableWatermarking
  • UpdateWatermarkDefinitions

Difficulty:

If you really want to watermark your own DWFs, here are the basic steps:

  • Find a DWF viewer with an API.  Offhand, I don’t know if any exist.
  • Grab the DWF for a given Item.
  • Grab all watermarks from Vault.
  • Figure out which watermarks apply to the DWF.
  • Render the watermarks on the DWF view.


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading