2016-06-24 5 views
0

방금 ​​DocuSign을 사용하여 개발자 계정을 만들었으며 외관상 봉투에 첨부해야하는 문서에 HTML 템플릿을 사용할 수 있는지 알아야합니다. 나는 이것을 위해 REST API를 사용할 계획이다. 그러나 가능한지 알고 싶습니다. 문서에서 볼 수있는 것은 PDF와 템플릿 생성기뿐입니다.REST API의 HTML을 사용하여 Docusign 템플릿을 만들 수 있습니까?

내 목표는 내 애플리케이션에서 바로 템플릿 (HTML)을 생성하여 템플릿으로 템플릿에 보내는 것입니다.

도움이 될 것입니다.

미리 감사드립니다.

+0

"HTML 템플릿"이란 무엇을 의미합니까? DocuSign 템플릿은 계정에 존재하며 문서, 수신자, 탭 및 기타 정보가 포함 된 서버 측 객체입니다. 클래식 UI를 사용하여 템플릿 정의를 다운로드하면 XML 형식임을 알 수 있습니다. 모든 것을 말하면, 앱은 그것이 의미하는 바가 있다면 즉석에서 문서를 생성하고 해당 문서 및 데이터 등으로 봉투를 실시간으로 생성 할 수 있습니다. – Ergin

+0

아래의 예에 따르면 예를 들어 DocuSign에 HTML 콘텐츠를 보내고 노력 - 콘텐츠가 PDF로 변환된다는 점에 유의하십시오. 다양한 HTML 속성의 변환 및 지원에는 표준 HTML 구성 요소의 대부분을 지원해야하지만 제한이 있습니다. –

+0

그래, 내가 HTML 템플릿을 통과하고 그것을 PDF로 변환 할 수 있기를 바란다. –

답변

1

마지막으로 PHP SDK를 사용하여이 작업을 수행 할 수있었습니다. 여러분이 여기에 대해 알고 싶다면 어떻게해야할까요?

// set recipient information 
$recipientName = ""; 
$recipientEmail = ""; 

// configure the document we want signed 
$documentFileName = "/../document.html"; 
$documentName = "document.html"; 

// instantiate a new envelopeApi object 
$envelopeApi = new DocuSign\eSign\Api\EnvelopesApi($this->getApiClient()); 

// Add a document to the envelope 
$document = new DocuSign\eSign\Model\Document(); 
$document->setDocumentBase64(base64_encode(file_get_contents(__DIR__ . $documentFileName))); 
$document->setName($documentName); 
$document->setFileExtension('html'); 
$document->setDocumentId("2"); 

// Create a |SignHere| tab somewhere on the document for the recipient to sign 
$signHere = new \DocuSign\eSign\Model\SignHere(); 
$signHere->setXPosition("100"); 
$signHere->setYPosition("100"); 
$signHere->setDocumentId("2"); 
$signHere->setPageNumber("1"); 
$signHere->setRecipientId("1"); 

// add the signature tab to the envelope's list of tabs 
$tabs = new DocuSign\eSign\Model\Tabs(); 
$tabs->setSignHereTabs(array($signHere)); 

// add a signer to the envelope 
$signer = new \DocuSign\eSign\Model\Signer(); 
$signer->setEmail($recipientEmail); 
$signer->setName($recipientName); 
$signer->setRecipientId("1"); 
$signer->setTabs($tabs); 
$signer->setClientUserId("1234"); // must set this to embed the recipient! 

// Add a recipient to sign the document 
$recipients = new DocuSign\eSign\Model\Recipients(); 
$recipients->setSigners(array($signer)); 
$envelop_definition = new DocuSign\eSign\Model\EnvelopeDefinition(); 
$envelop_definition->setEmailSubject("[DocuSign PHP SDK] - Please sign this doc"); 

// set envelope status to "sent" to immediately send the signature request 
$envelop_definition->setStatus("sent"); 
$envelop_definition->setRecipients($recipients); 
$envelop_definition->setDocuments(array($document)); 

// create and send the envelope! (aka signature request) 
$envelop_summary = $envelopeApi->createEnvelope($accountId, $envelop_definition, null); 
echo "$envelop_summary\n"; 

나는 더 깊은 문서를 파고 들었다. 다음은 source입니다.

관련 문제