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

ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

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

Tags (1)
4 REPLIES 4

Re: ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

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

Highlighted

Re: ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

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

Re: ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

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

Re: ProPDFExport - PRO_PDFOPT_VIEW_TO_EXPORT

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.