Skip to main content
15-Moonstone
August 16, 2013
Question

ProPDFExport

  • August 16, 2013
  • 1 reply
  • 1329 views
Does anyone have any sample code for using ProPDFExport they'd be
willing to share. There is no sample code, and I'm having some trouble
with the option. Or maybe someone can just see what I'm missing here.

The function is returning me -2 (Bad Inputs. ) Here is a condensed
version of my setup and funtion call. The intention is to set these two
options and take the default on the rest. FilenameW and mdlDrawing
arguments are fine, it's the options that is invalid. I am somehow not
setting up the ProPDFOptions correctly.





ProPDFOptions *MyPDFOptions;



ProPDFoptionsAlloc(MyPDFOptions);

ProPDFoptionsIntpropertySet(MyPDFOptions, PRO_PDFOPT_FONT_STROKE,
PRO_PDF_STROKE_ALL_FONTS);

ProPDFoptionsIntpropertySet(MyPDFOptions, PRO_PDFOPT_COLOR_DEPTH,
PRO_PDF_CD_MONO);



fprintf(fp,"%s\n",Path);





ProStringToWstring(fileNameW, Path);

tkerr = ProPDFExport (mdlDrawing, fileNameW, MyPDFOptions);



Thanks,

Mark Steffke

Engineering System Administrator

The Delfield Company

Manitowoc Foodservice

T 989.775.9215 or 989.773.7981, ext 12484

Integrity, Commitment to Stakeholders, and Passion for Excellence




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.

1 reply

10-Marble
August 17, 2013

Hi Mark,


I think your problem is caused due to the declaration of MyPDFOptions as a pointer whereas it should be a ProPDFOptions variable.



So if you change your code to:


ProPDFOptions MyPDFOptions;


ProPDFoptionsAlloc( &MyPDFOptions);


....


it should work.


I got a very similar piece of code that works without problems:


ProPDFOptions PDFoptions;

err = ProPDFoptionsAlloc(&PDFoptions);
err = ProPDFoptionsIntpropertySet(PDFoptions, PRO_PDFOPT_COLOR_DEPTH, PRO_PDF_CD_MONO);
err = ProPDFoptionsBoolpropertySet(PDFoptions, PRO_PDFOPT_LAUNCH_VIEWER, PRO_B_FALSE);
err = ProPDFExport (model, w_pdfpath, PDFoptions );
err = ProPDFoptionsFree (PDFoptions);



Best regards,


Jan



AGFA Graphics NV


Belgium




In Reply to Mark Steffke:


Does anyone have any sample code for using ProPDFExport they'd be
willing to share. There is no sample code, and I'm having some trouble
with the option. Or maybe someone can just see what I'm missing here.

The function is returning me -2 (Bad Inputs. ) Here is a condensed
version of my setup and funtion call. The intention is to set these two
options and take the default on the rest. FilenameW and mdlDrawing
arguments are fine, it's the options that is invalid. I am somehow not
setting up the ProPDFOptions correctly.





ProPDFOptions *MyPDFOptions;



ProPDFoptionsAlloc(MyPDFOptions);

ProPDFoptionsIntpropertySet(MyPDFOptions, PRO_PDFOPT_FONT_STROKE,
PRO_PDF_STROKE_ALL_FONTS);

ProPDFoptionsIntpropertySet(MyPDFOptions, PRO_PDFOPT_COLOR_DEPTH,
PRO_PDF_CD_MONO);



fprintf(fp,"%s\n",Path);





ProStringToWstring(fileNameW, Path);

tkerr = ProPDFExport (mdlDrawing, fileNameW, MyPDFOptions);



Thanks,

Mark Steffke

Engineering System Administrator

The Delfield Company

Manitowoc Foodservice

T 989.775.9215 or 989.773.7981, ext 12484

Integrity, Commitment to Stakeholders, and Passion for Excellence