Skip to main content
1-Visitor
May 11, 2010
Question

Drawings as PDF - Quick way to download them?

  • May 11, 2010
  • 95 replies
  • 33905 views
I have my drawings being published as a PDF by my Pro/e CAD worker. This is fine but in the end my users really need to be able to quickly download or email the PDF. Currently the only way to get the PDF out is to do the following:
1- Go to Drawing Details Page
2- Select "Display Representations List"
3- Click Actions>Save Representation
4- Save Representation out as .zip file to desktop
5- Extract PDF from .zip file and email etc

WAY to much work...does anyone know of a more efficient way to do this?

95 replies

1-Visitor
August 11, 2010

Hello ED (ALL), I could have been wrong about where the customRB.rbInfo file should be located,
in order to be seen & compiled properly by ResourceBuild:

create "repsave" folder in:

<wt_home>\codebase\com\ptc\windchill\enterprise

then create another "repsave" folder in the src area:

<wt_home>\src\com\ptc\windchill\enterprise\

then place a customRB.rbInfo in the repsave folder

(<wt_home>\src\com\ptc\windchill\enterprise\repsave)

the contents of the customRB.rbInfo file should be:

repsave.REPSAVEAS.title.value=Download DRW PDF or PLT
repsave.REPSAVEAS.icon.value=download.gif
repsave.REPSAVEAS.tooltip.value=Download DRW PDF or PLT
repsave.REPSAVEAS.description.value=Download DRW PDF or PLT
repsave.REPSAVEAS.moreurlinfo.value=height=400,width=700, scrollbars=yes

I have attached that RB file (customRB.rbInfo.txt where you rename without .txt).

Then to build the resource, run this in windchill shell:

ResourceBuild com.ptc.windchill.enterprise.repsave.customRB

Then make sure you custom-actions.xml reads as below:



<listofactions>
<objecttype name="repsave" class="wt.epm.EPMDocument" resourcebundle="com.ptc.windchill.enterprise.repsave.customRB">
<action name="REPSAVEAS">
<description>Download DRW PDF or PLT</description>
<command windowtype="popup"" url="wtcore/jsp/repsave/REPSAVEAS.jsp"/">
</action>
</objecttype>
</listofactions>

Hope this is right. Actually, this might be better than inserting in wvs RB file, since
we are doing custom work anyway & custom actions files are being used. Why nota customRB also.

Let me know if there are any errors &/or if it works.

L Jett
cadjett@aol.com,datajett@aol.com

1-Visitor
August 11, 2010

Lawrence, I followed the instructions in your last post but I cant get past the resourcebuild, still fails. Its getting late in the day here,so I'll double check everything tomorrow morning.

1-Visitor
August 11, 2010

Hey ED, I have not actually tried to get the customRB.rbInfo to work, as I had specified in my last post.

I mainly went on my previous setup & on Swami's post, where he suggested customRB. His post looked good, but he does not specify where to place the .rbInfo file. So I assumed <wt_home>\src\com\ptc\windchill\enterprise\repsave, because of the previous location of the .rbInfo file I edited & its path: <wt_home>\src\com\ptc\windchill\enterprise\wvs\WVSactionsResource.rbInfo

But let me actually place a customRB.rbInfo file in that repsave folder under enterprise & see if it will compile with ResourceBuild.

I of course will change the contents of the .rbInfo file to something like:

repsave.REPSAVEAS.title.value=TEST Download DRW PDF or PLT
repsave.REPSAVEAS.icon.value=download.gif
repsave.REPSAVEAS.tooltip.value=TEST Download DRW PDF or PLT
repsave.REPSAVEAS.description.value=TEST Download DRW PDF or PLT
repsave.REPSAVEAS.moreurlinfo.value=height=400,width=700, scrollbars=yes

Then if it compiles & build class, I will maybe add to my actions xml files, where I already have repsave & 2 test entries to test code.

If any gurus want to test the customRB.info concept or suggest other, let us know.

The other route I suggest is to place it in one of the wvs rb info files that you did find on wc9.0 & then point y9our custom actions xml to that rb file, of course after you get a successful ResourceBuild.

I think you could put those rb info contents in most any rb info file, just so you actions xml file points to it. But then again, I am still in rookie mode, so I dont know.

Ed, I will let you know what I find.

L Jett

1-Visitor
August 11, 2010

Hey ED (ALL), My Bad. I missed the header content for the customRB.rbInfo file:

Contents should be:

ResourceInfo.class=wt.tools.resource.StringResourceInfo
ResourceInfo.customizable=true
ResourceInfo.deprecated=false

repsave.REPSAVEAS.title.value=Download DRW PDF or PLT
repsave.REPSAVEAS.icon.value=download.gif
repsave.REPSAVEAS.tooltip.value=Download DRW PDF or PLT
repsave.REPSAVEAS.description.value=Download DRW PDF or PLT
repsave.REPSAVEAS.moreurlinfo.value=height=400,width=700, scrollbars=yes

I have attached an updated customRB.rbInfo.txt file (remove.txt).

I ran the update on my vmware & the ResourceBuild response was:

BUILD SUCCESSFUL

L Jett

1-Visitor
August 12, 2010

I added the latest customRB.rbInfo to the codebase\com\ptc\windchill\enterprise\repsave folder and I now have a successful resource build. I guess the next question is, what xml files do I need to edit at this point ? Also for the last step, do I still add the four java and class files to the folder specified ( <wt_home>\codebase\ext) ?

1-Visitor
August 13, 2010

You are not far away from it allworking.

Just follow the readme file:

http://www.datajett.com/windchill/wc_dev/saverep/saverep_readme.txt

If you have not edited the xml files, they are custom-actions.xml & custom-actionModels.xml.

In the custom-actions.xml, make sure to change the resourceBundle value from:

com.ptc.windchill.enterprise.wvs.WVSactionsResource
to
com.ptc.windchill.enterprise.repsave.customRB

Then copy the REPSAVEAS.jsp to (<wt_home>\codebase\wtcore\jsp\repsave)
Then copy the dlRep.class to the(<wt_home>\codebase\ext)folder.

If you run into any errors, maybe look at deleting my class & compiling the java your self.

You only need to copy the dlRep_main.class to the ext,if you want to run it from command line.

Some folks place the java files in the src area, I place them in ext & compile there.
Bad habit, but thats what I am used to. Less command line compile args.

If you have your system publishing DRW's to pdf, then you are good to go.

If they are instead set to plt, then change the jsp:
Change the jsp line:

String conType = "pdf";
to
String conType = "plt";

Then stop/start method server. Let me know if you run into any issues.

L Jett

1-Visitor
August 13, 2010

OK, Im getting very close to this working now:

Inow get the download pdf or plt option in the actions menu.Choosing that action,I next get awindowsscreen as follows:

PDF or PLT Object/Download Info:
CAD Doc Number: 18056.DRW
CAD Doc Name: 18056.drw
Revision: F.1
Container: wt.pdmlink.PDMLinkProduct:14790
Product/Libray: OR:wt.pdmlink.PDMLinkProduct:14790
Download Location: c:\TEMP (Configurable)
Representation/Content Type: plt (Configurable)

Problem is, no file appears in the c:\temp folder.

If I run from the command line, here is what I get:

C:\PTC\Windchill_9.0\Windchill>java ext.dlrep_main ctemp 1800% plt

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

Any ideas what to rty next ?

avillanueva
23-Emerald I
23-Emerald I
August 13, 2010
The means you are running with the wrong Java version. Its trying to
execute code that was compiled in a higher version.
1-Visitor
August 15, 2010


Ed, try these tests/changes:

1) recompile, like Antonio suggests:

cd /d C:\PTC\Windchill_9.0\Windchill\codebase\ext

compile both:

javac dlRep.java
javac dlRep_main.java

Then run again:

java ext.dlRep_main c:\\temp 1800% plt

2) maybe message typo or command line error:

C:\PTC\Windchill_9.0\Windchill>

java ext.dlrep_main ctemp 1800% plt

should be:

java ext.dlRep_main c:\\temp 1800% plt (as shown above).

3) see that yor JSP has: C:\\temp (with 2 \'s)

4) did you look for the plt in the C:\\temp on your windchill server, because if the dlLoc is not URL, it will download/save to the folder on windchill server.

5) set your dlLoc in JSP to URL. dlLoc = "URL"; Then your popup should have the plt download hyperlinked within, which allows the plt to be downloaded towhere you want it.

Try these & let us know what happens.

L Jett

1-Visitor
August 17, 2010

Lawrence,

thanks for the help again. Looks like the recompiling did the trick, although I did get a warning message when recompiling the dlRep_main.java file. Now both the windchill app and command line version work which is very neat. Next Im going to look for a utility to automatically convert .plt files to pdfs, this way windchill users can just download the plt and hoepfully convert automatically to pdf. Anyone out there know of such a utility ? We currently use cutepdf with product viewlite where users have to open the drawing then print to pdf.