Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Auto save PDF with file selection
Topic Summary:
Created On: 10-May-2007 21:33
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 10-May-2007 21:33
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

OK, so here's the deal. I've got a script that I've wrote that uses the printModule function to print the module to an Adobe PDF document.  The script automatically selects the Adobe PDF printer by setting the default printer in the registry using the setRegistry() command.  I'm using the showPrintDialogs() to hide the print dialog.  Now my question is this, when the printModule function is called I still get the file selector asking me where I want to save the pdf file, which is normal, but how do I 1. pass the save location and file name and 2. not display that dialog?

This is the final piece to my puzzle and I'm lost....lol.

Thanks in advance.

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 16-May-2007 15:26
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

OK...I figured this one out on my own, so in case anyone else is wondering, here's how you can save a module to PDF without the save dialog popping up.

Basically you need to update the registry.  You can do this with the "getRegistry" and "setRegistry" functions.

First you need to get the default printer, so you can reset it after your done. Create a Buffer or string variable and set it using the "getRegistry" function.
Next you need to set the default printer to adobe using the "setRegistry" function.
Then using the "setRegistry" function again to pass the file location and name to Adobe Distiller.
Print your module to PDF using the printModule command...
Then reset the default printer using the "setRegistry" command.

See the attached code for an example.

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.