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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

How do I plot a drawing to a postscript file using jlink?

RandyJones
19-Tanzanite

How do I plot a drawing to a postscript file using jlink?

Wildfire 5.0 M170

I am looking for some example jlink code that will print/plot a drawing to a postscript file.
The following 2 links show examples for creating a pdf export:but I can't seem to find anything for creating a postscript file.

ModelDescriptor descr = pfcModel.ModelDescriptor_Create(ModelType.MDL_DRAWING, partNumber, null);
Model dwg = session.RetrieveModel(descr);
Window window = session.CreateModelWindow(dwg);
dwg.Display();//This part works because the drawing is opened and displayed
PrinterInstructions pi = pfcExport.Print...

















This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2
bfrandsen
6-Contributor
(To:RandyJones)

Try to use full path for both SetFileName() and SetPenTable() methods.
There might be useful information in any exception thrown from the application as well.

/Bjarne

Updates on this question. I opened a case with PTC which resulted in 2 new articles in their
Knowledge Base and some key word additions to 2 existing articles so they are more likely to be
found when searching. These are good articles with that also contain the most important items: code
examples

The list of articles follows. The last 2 are new and the first 2 were already created when I was
having this issue.

  * CS78845 <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS78845>
      o How to display retrieved models in a new window through JLink for Creo Parametric
        <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS78845>
  * CS95315 <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS95315>
      o While printing drawing models, calling Model.Export() on a drawing in inactive window fails
        with exception "pfcExceptions::XToolkitBadInputs" in JLink for Creo Parametric
        <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS95315>
  * CS115415 <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS115415>
      o Model.Export() randomly throws XToolkitGeneralError exception on every other drawing when
        used in a loop to plot multiple drawing files through a synchronous *JLink* application for
        Creo Parametric. <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS115415>
  * CS111626 <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS111626>
      o Example code to plot drawing files to *POSTSCRIPT* through *JLink* for Creo Parametric
        <">https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS111626>



Top Tags