cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Drawings as PDF - Quick way to download them?

SteveVinyard
1-Newbie

Drawings as PDF - Quick way to download them?

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?
96 REPLIES 96

Glad to see all have running batch now.

I did updatethe readme file, to included customRB info.

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

even if you are on wc9.1 & you can find the WVSactionsResource & place it there, the custom?? anything is probably best route, as to not mess with OOTB.

L Jett

Some one emailed me directly & mentioned that their install of this tool, didn't follow their ACL permissions.

I guess I assumed the ACL for download would control who could & could not use this tool, so I didn't dig into writing code (jsp/class) that would check for download access. As I mentioned before, this was all on free time & my vmwares are lacking the real production users, acl, etc to replicate & test a real production scenario.

So what I would like to question/request from those knowledgeable in this area, what method is best to remedy this situation.

I imagine I could write jsp/class to check permissions, but that could be lengthy & messy. But what methods does Windchill use to keep the action menu options from being seen by the wrong users. It seems to do very well at hiding action menu options from particular logins (acl permissions). What route does it use. I have scanned a few docs/guides, but its does not seem to stand out.

I can look longer/harder, but sometimes some one has it off the top of there head here in the ptc forums.

Might it be in the actions & actionModels xml files. Where the type of menu option is exclaimed:

<actionmodels>
<model name="epmdocuments" details=" page=" actions&quot;=" menufor="wt.epm.EPMDocument">
...
<action name="WFDOWNLOAD"" type="epmdocument"/">
...
<action name="create"" type="changeRequest"/">
...
<action name="MULTI_OBJ_DELETE"" type="pdmObject"/">
...
<action name="listRepresentations"" type="wvs"/">
...
</actionmodels>

does the type (epmdocument, changeRequest, wvs or pdmObject) control what ACL permissions are applied?

If so, I hope its applied in the custom actions xml's area also.

If this is the case, then the way I placed/used the type with this tool, might be causing issues:

<action name="REPSAVEAS"" type="repsave"/">

If this is the case, can I add "repsave" to some properties or ?? file, so windchill will view it as a wvs, epmdocument, etc & therefore apply the proper ACL permissions.

Or should I change the type to wvs/epmdocument, in order to put it under the same acl control of those particular types.

If so, I would then have to place the jsp in a different jsp folder:

<wt_home>\codebase\wtcore\jsp\wvs or epmdocument, etc.

It would be nice if I could just add repsave to a properties file & then ACL permissions would be applied property.

Any ideas/thoughts about the quickest, but most proper method to do this.

L Jett
cadjett@aol.com;datajett@aol.com (main email)

I should be publishing a sophisticated action filter add on for free in the near future.

The customizer's guide tells you how to write these using UIValidationStatus.HIDDEN.

You can search the pdf for reference to it.

The most basic control is to lock it for all users and allow only a certain role. In your actions XML, define a unique uicomponent attribute and then edit roleaccessprefs.xml

You will have to bounce server and then going to profiles or likely each context team minor tab page and select configure actions for roles. From that popup UI, your custom action appear giving you ability to allow the action to only be visible for a certain role.

The one I'll be publishing will be 1000 times more flexible. It will allow you to grant access to an action based on any combination you think like soft attrubte values, pending changes, soft types, lifecycle templates, folder, folder atts, product, product types/atts, roles, groups, version, iteration, and more.

Outside of actions, you would have to use AccessControlHelper hasAccess methods.


David DeMay


Sent from my Verizon Wireless BlackBerry

This looks to be exactly like what I need

Of course I will have to get familiar with the areas you mention & my vmware is down, since I am on the road AGAIN. But as soon as I can, I will play around with the areas in your comments.

The only thing I might not do it block usage from all users (except for one), because I want to make it to where most any designer can download a pdf to send to a vendor. Not force it into an admin or special usertask.

But also resctrict access to those that dont have download, etc permissions (like vendors, etc).

Then some that want external vendors to be able to (so they dont have to be emailed thepdfto them), would just have to adjust ACL's on their account.

But it looks to be good stuff & I cant wait to jump into it & adjust my code &/or show what access xml edits to preform to limit usage of the menus &/or apps.

Thanks
L Jett

AdamFagan
5-Regular Member
(To:SteveVinyard)

Larry,

I am trying to implement this and I'm getting the following errors:

actionmodels.xml file is missing an entry called header_actions. Please add the model and restart the server.
actionmodels.xml file is missing an entry called home_assignments_actions_toolbar. Please add the model and restart the server.
actionmodels.xml file is missing an entry called updatelist_actions. Please add the model and restart the server.
actionmodels.xml file is missing an entry called checkoutlist_actions. Please add the model and restart the server.

Have you seen this error before? I used the zip file dated August 11, 2010 and your readme file dated Sept. 25, 2010. Any help would be greatly appreciated.

Regards,

Adam

Did you validate the XML syntax is valid? Those are all core action models
and it sounds as if Windchill is not able to parse the XML correctly. No
parse exception in log files?




AdamFagan
5-Regular Member
(To:SteveVinyard)

Dave,

Thank you for your repsonse. I do see the following line in the logs but there is no stack trace or further information:

main: [Fatal Error] :11:2: The markup in the document following the root element must be well-formed.

I'm using the attached readme file. I am a bit confused as to what goes into the file custom-actions.xml however I think the error is possibly with the custom-actionModels.xml.

It might also be important to know we are running 9.1 M050.

-Adam

Hello Adam,

I dont have my windchill vmware available right now, but from memory I will try.

The error code looks like one of a couple possibilities:

1) There is an error in your readme file (otherwise old error in my file):

It has:

Copy Content below & paste to:

<wt_home>\codebase\config\actions\custom-actions.xml

com.ptc.windchill.enterprise.wvs.WVSactionsResource



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

AdamFagan
5-Regular Member
(To:SteveVinyard)

Thanks for your help. I was able to get thisworking with the new readme file. Initially it was giving me some fits but after I cleared tomcat cache and compliedTasks it appears to be running brilliantly. Thanks again and Happy Holidays!

Regards,

-Adam

Hello all-

I am having a problem with this not retrieving the latest version of the PDF. If I use the Download PDF link it pulls a different version then the one that I am looking at. My batch File that creates all the PDFs is a different version then the current and from what is in the Download PDF Link. Is there a way to make sure it us pulling the latest? If I look at the List of Representations that one is correct.

.

Well the config spec gurus might know better than I.

As far as I know, with the java classes the jsp uses, Its grabbing the pdf that is associated to that specific DRW & its rev.

But there might be system setting forsome config spec that forces which pdf ver to pull.

Whether is be latest or other.

Then again, maybe the alternate method you are speaking of, uses the system config spec, where my program/classmight not.

Any ideas, from the guru gallery?

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

Is there a good intro to using Java with PDM link? I can figure out the code by the guides and the Internet, but just need to know how to get started.


Thanks

Sorry, had to change your subject there. I would start with the
Windchill Customizer's guide. What kind of queries are you looking to
run? You can run them from the Oracle level (SQL), Report Manager
(inside of Windchill) or Cognos. All do not require restart. You can
run a query via Java Code either through InfoEngine tasks or direct API
calls. Again, no restart needed. It depends on what information your are
looking for, what format you want it in and what the purpose is.


jython is also a nice way to play with the api, and if you download
ext.tools from pdmteam.com you will find a bat file (wt.bat) and the
ListAll class to query lots of windchill related data from the command line.

hth, martin

What I am trying to do is understand this Drawings to PDF Script. I am having an issues where it is not pulling the latest version. So I was trying to follow the code and run some tests. If I could figure out how to run a piece of the code at a time, It could help me fiigure out my issue.

I am tring to print out the LC state on the download page.I am editing REPSAVEAS.jsp I keep getting errors on the property I am adding "epmdoc.getLifeCycleState();"


Is that not correct? I have tried


"epmdoc.getLifeCycleState() .getValue();


"epmdoc.getLifeCycleState(); .toString();


Thanks



Hello Keith,

You should be able to use the same method that is used in the java class/code:

Add this line:

out.println("Life Cycle State: "+epmdoc.getLifeCycleState().toString());

If that does not work, add these 2 lines instead:

String LC_state = epmdoc.getLifeCycleState().toString();
out.println("Life Cycle State: "+LC_state);

Let me know ifeither works or not.

If it still work work, I am not sure, but you might need to flush the existing jsp_class, by flushing tomcat cache
(stop wc, stop tomcat, delete catalina folderin tomcat work folder &/or work folder, then restart tomcat & wc)

L Jett
cadjett@aol.com;datajett@aol.com (for quicker response)

Thanks that did the trick.

I am still having an issue where the pop box shows released, but the drawing
is not the released version when using the Action menu Download to PDF.

I have found an easy way to download PDF Objects out of Windchill including all markups etc. If you have the Adobe Support CD installed on your client (PTC's adobe acrobat viewer which gives you GREAT pdf markup tools) then you simply click in the drawing and hit CTRL+SHIFT+S and it will allow you to save the PDF out.

One of the really nice things I like about this is that it saves all of the default PDF bookmarks. The default bookmarks represent the views that are imported in from the drawing itself. You can easily cycle through those views and see the detail views, cross sections iirc.


[cid:image001.gif@01CBDFC9.71867990]

Steve Vinyard
Application Engineer

Actually found that this works with Adobe Reader as well.

[cid:image001.gif@01CBDFCE.644101B0]

Steve Vinyard
Application Engineer
mspencer
5-Regular Member
(To:SteveVinyard)

Sorry to kick an old thread... but has someone implemented this in 10.0? It appears that in 10 the WVSactionsResource.rbinfo file is now .java, so the resource build command fails.


Thanks, Max

Hi,


In WC10, most of the RBINFO files are java files. So, old ResourceBuild will not work for them.


Instead you can compile them the way normal java files are compiled from windchill shell which will copy the class file to respective folder in codebase.


go to source directory in windchill shell where resource java file is available then run below command:


javac -d <windchill_codebase_path> XXXXXXXXResource.java



Regards,


Raghavendra

I understood 10.1 was planned to have a direct PDF download action OOTB. We are following up with Madhavi from PTC for an update now that 10.1 is available

jtjohnson
5-Regular Member
(To:SteveVinyard)

Hello my old friend Jeff Thornton!!



Hope you and family are well.



This is available with 10.1, I just tested it.



Regards,

Jeff


Wow, this is great news. So I assume IF the drawing has been published as a PDF then you can simply right click and say download PDF right?

[cid:image001.gif@01CD290B.81F86090]

Steve Vinyard
Application Engineer

Yes or does this imply a conversion capability automatically?


Sent from my Verizon Wireless BlackBerry
jtjohnson
5-Regular Member
(To:SteveVinyard)

It does not convert on the fly. The new function allows you to RMB on
the representation in the reps table (not the thumbnail), and download
the rep. It creates a zip or a rar (your choice) of the rep and the
thumbnail.



Jeff


This has been in Windchill for years right?? Or is it different now??

If you publish your drawings as a PDF you can simply download the rep .zip and then extract it out of that.


[cid:image001.png@01CD2913.AB128ED0]

[cid:image002.png@01CD2913.A29F03A0]

[cid:image003.gif@01CD2913.A29F03A0]

Steve Vinyard
Application Engineer

10.1 provides a


See also an enhancement that was just created to make this direct download accessing from search results


http://communities.ptc.com/ideas/1185

That's great. Almost there. We just need this option directly from the RMB ANYWHERE on a drawing 🙂 Glad an enhancement is out there. My users certainly don't want to have to dig just to get a PDF out.

[cid:image001.gif@01CD2927.D9C1C2F0]

Steve Vinyard
Application Engineer
Top Tags