PDF
Download PDF
Download page Converting a Word Document into a PDF for Standard Objects.
Converting a Word Document into a PDF for Standard Objects
This converts a Word document into a PDF document for a standard object. It can be any Word document and does not have to be created using generateDoc or generateSupportingDoc. The protection level applicable to the Word document is not applicable to the PDF document.
API | Signature |
---|---|
convertWordDocToPDF2 | webService static Id convertWordDocToPDF2(Id docId, String docFileName, Id sObjectId, String pLevel, Boolean addWatermark, Boolean removeWatermark, String headerText, String footerText, String sessionId, String serverUrl) |
Request Parameters | |||
---|---|---|---|
Name | Type | Description | Required? |
docId | ID | The id of the word document to be converted to PDF. | Yes |
docFileName | String | The filename for the newly created PDF. | Yes |
sObjectId | Id | The id of the standard object. | Yes |
pLevel | String | The protection level to apply to the document. Valid values are:
| Yes |
addWatermark | Boolean | Indicates whether a draft watermark should be added to the PDF. | Yes |
removeWatermark | Boolean | Indicates whether a draft watermark on the source word document should be removed from the resulting PDF. | Yes |
headerText | String | The header text to append to the document. | Yes |
footerText | String | The footer text to append to the document. | Yes |
sessionId | String | The Salesforce session id. | Yes |
serverUrl | String | The Salesforce server URL. | Yes |
Response Parameter | ||
---|---|---|
Name | Type | Description |
result | ID | The id of the generated document. |
Code Sample
ID docId = 'a0Y61000002K6IR';
String docFileName = 'Agreement';
ID sObjectId = null;
String pLevel = null;
Boolean addWatermark = true;
Boolean removeWatermark = false;
String headerText = 'Agreement Id: 0123456789';
String footerText = 'Date Created: 11/27/2018 7:23:15 PM';
String sessionId = sessionId; //This is the session Id.
String serverUrl = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/50.0/' + UserInfo.getOrganizationId();
ID ConvertedDocId = Apttus.MergeWebService.convertWordDocToPDF2(docId,docFileName,sObjectId,pLevel,addWatermark,removeWatermark,headerText,footerText,sessionId,serverUrl);
CODE
Integration Details
Use the following information in your integrations with Apttus Contract Management Web Services API. For information on how to get started, refer to Integrating Conga CLM with External Systems.
API Prerequisites
None.
Request/Response XML
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mer="http://soap.sforce.com/schemas/class/Apttus/MergeWebService">
<soapenv:Header>
<mer:SessionHeader>
<mer:sessionId>00D020000008lUh!AQYAQPYE.vw_Vh7FI.cV871nm9WWqIdhVINQJIl7PDNzr3fLVNdGjwk9qTJbDYIRoxbfpa44bpuIyeyVxEepPxdubr_AWjOv</mer:sessionId>
</mer:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<mer:convertWordDocToPDF2>
<mer:docId>00P02000000IY8p</mer:docId>
<mer:docFileName>MS-NDA-Regenerated_TemplateWithOrgClause_ct__.docx</mer:docFileName>
<mer:sObjectId>a07020000008w91</mer:sObjectId>
<mer:pLevel>Full Access</mer:pLevel>
<mer:addWatermark>False</mer:addWatermark>
<mer:removeWatermark>False</mer:removeWatermark>
<mer:headerText>Company</mer:headerText>
<mer:footerText>Copyright 2020</mer:footerText>
<mer:sessionId>00D020000008lUh!AQYAQPYE.vw_Vh7FI.cV871nm9WWqIdhVINQJIl7PDNzr3fLVNdGjwk9qTJbDYIRoxbfpa44bpuIyeyVxEepPxdubr_AWjOv</mer:sessionId>
<mer:serverUrl>https://testmanaged--5s20minor.my.salesforce.com/services/Soap/u/50.0/00D020000008lUh</mer:serverUrl>
</mer:convertWordDocToPDF2>
</soapenv:Body>
</soapenv:Envelope>
XML
Example Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus/MergeWebService">
<soapenv:Body>
<convertWordDocToPDF2Response>
<result>00P02000000IayZEAS</result>
</convertWordDocToPDF2Response>
</soapenv:Body>
</soapenv:Envelope>
XML