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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Creating a PDF with Web.Link?

amarten
1-Newbie

Creating a PDF with Web.Link?

I have been trying to use Web.Link to create PDFs of drawings from CREO 2.0 Parametric.  I can successfully get it to create the PDF with all of the standard settings but i need to change the output color to monochrome and have it only PDF the first sheet.  The users guide is not very helpful with this, it lists the available options and option values but I can not figure out how to apply them to the pdf instructions.  I can not seem to assign the OptionValue as per the UG -

 

OptionValue—Specifies the value of the option in terms of the pfcArgValue object. Set this option using

the property pfcExport.PDFOption.SetOptionValue.

 

I can set the OptionType by assigning the desired value -

 

 

  var color = pfcCreate ("pfcPDFOptionType").PDFOPT_COLOR_DEPTH;
  var colorSet = (pfcCreate ("pfcPDFColorDepth").PDF_CD_MONO);
   
  var pdfColor = pfcCreate ("pfcPDFOption").Create();      
       
  pdfColor.OptionType = color;

 

But if I do the same with the OptionValue it fails, or if i use SetOptionValue it fails.

 

Also how do you set the collection of PDF options? -

 

Use the property pfcPDFExportInstructions.Options to set the collection of PDF export options.

 

Any help is much appreciated.

 

Thanks,

-Alex


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 ACCEPTED SOLUTION

Accepted Solutions

For anyone interested in an answer I have figured this out.

You must create an Options collection

//create options
var myOptions = pfcCreate ("pfcPDFOptions")

Then create a new option and create the appropriate variables for type and value

var pdfColor = pfcCreate ("pfcPDFOption").Create();
pdfColor.OptionType = (pfcCreate ("pfcPDFOptionType").PDFOPT_COLOR_DEPTH);
var colorSet = pfcCreate ("pfcPDFColorDepth").PDF_CD_MONO;

Then create an Argument Object with the proper type of agrument (Boolean, Interger ...) and the OptionValue as the input.

var pdfArg = pfcCreate ("MpfcArgument").CreateIntArgValue(colorSet);

Set the OptionValue

pdfColor.OptionValue=(pdfArg);

And append the option collection

myOptions.Append(pdfColor);

When you create the instructions set initialize the Options value and set the options collection

var pdfInstructions = pfcCreate ("pfcPDFExportInstructions");
var inst = pdfInstructions.Create();
inst.Options = myOptions;

You can append any number of options to the option collection.

I hope this helps someone, the UG is not very clear on this.

Thanks,

Alex

View solution in original post

1 REPLY 1

For anyone interested in an answer I have figured this out.

You must create an Options collection

//create options
var myOptions = pfcCreate ("pfcPDFOptions")

Then create a new option and create the appropriate variables for type and value

var pdfColor = pfcCreate ("pfcPDFOption").Create();
pdfColor.OptionType = (pfcCreate ("pfcPDFOptionType").PDFOPT_COLOR_DEPTH);
var colorSet = pfcCreate ("pfcPDFColorDepth").PDF_CD_MONO;

Then create an Argument Object with the proper type of agrument (Boolean, Interger ...) and the OptionValue as the input.

var pdfArg = pfcCreate ("MpfcArgument").CreateIntArgValue(colorSet);

Set the OptionValue

pdfColor.OptionValue=(pdfArg);

And append the option collection

myOptions.Append(pdfColor);

When you create the instructions set initialize the Options value and set the options collection

var pdfInstructions = pfcCreate ("pfcPDFExportInstructions");
var inst = pdfInstructions.Create();
inst.Options = myOptions;

You can append any number of options to the option collection.

I hope this helps someone, the UG is not very clear on this.

Thanks,

Alex

Top Tags