Skip to main content
1-Visitor
July 23, 2015
Question

ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

  • July 23, 2015
  • 2 replies
  • 2030 views

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.

2 replies

lgüthle1-VisitorAuthor
1-Visitor
July 24, 2015

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

lgüthle1-VisitorAuthor
1-Visitor
August 10, 2015

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

1-Visitor
September 9, 2015

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