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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

lgüthle
1-Newbie

ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

Hey all,

I want to export a drawing to PDF using ProPDFExport.

As options I use following code snippet since I want to export a special view:

ProPDFOptions pdfOpt;

status = ProPDFoptionsAlloc(&pdfOpt);

status = ProPDFoptionsIntpropertySet(pdfOpt, PRO_PDFOPT_VIEW_TO_EXPORT,PRO_PDF_VIEW_SELECT_BY_NAME);

status = ProPDFoptionsStringpropertySet(pdfOpt,PRO_PDFOPT_SELECTED_VIEW, (wchar_t*)viewNameP);

status = ProPDFExport(drawing, pro_wszPath, pdfOpt);

status = ProPDFoptionsFree(pdfOpt);

at "ProPDFoptionsStringpropertySet(pdfOpt,PRO_PDFOPT_SELECTED_VIEW, (wchar_t*)viewNameP);" I got ProError "Bad Inputs".

So I checked my viewName by using ProViewRetrieve:

ProDrawingDimensionViewGet((ProDrawing)drawing,&dims[i],&viewTemp);

ProDrawingViewNameGet((ProDrawing)drawing,viewTemp, viewName);

ProLine vName;

wcscpy_s(vName, viewName);

status = ProViewRetrieve(drawing, vName, &viewTemp);

To explain: traverse through the dimensions of my ProMdl and ProDrawingViewNameGet works (I get the correct viewName as result). But copying the viewName to vName (ProLine) and then trying to use ProViewRetrieve I get the Error "A general error occurred and the function failed."

????

Someone any Ideas?

Best regards

Luis


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.
4 REPLIES 4

I want to rephrase my question: Is it possible to export views from a drawing as a image (tiff/pdf or something else)?

I found out that PDFoptions is not working for 2D views so I am trying something different:

1) get all Views (ProDrawingViewsCollect)

2) for each view get position (ProDrawingViewOriginGet) and get size (ProDrawingViewOutlineGet)

3) export whole sheet and crop with size and position information.

does someone know how to my last step? I dont know how to handle ProPoint3d[2] data...about the coordiantes I am getting back...

I am not sure whether below will be helpful to you or not:

  • Get all view
  • Move required view to new drawing sheet --> API I have not checked for this
  • Set PDF export option property as PRO_PDFOPT_SHEETS as newly added sheet.

Regards

Ketan

Luis,

I'm not sure how to do the cropping either but the function ProDrawingViewOutlineGet outputs the data points in screen coordinates.  In what coordinate system to you need the points?

Alternatively you could use ProPDFWithProfileExport and define the .dop xml file to do what you need.  I have never used a .dop to export a .PDF but it's worth a look to see what it's capabilities are.

Top Tags