마지막으로 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입니다.
"HTML 템플릿"이란 무엇을 의미합니까? DocuSign 템플릿은 계정에 존재하며 문서, 수신자, 탭 및 기타 정보가 포함 된 서버 측 객체입니다. 클래식 UI를 사용하여 템플릿 정의를 다운로드하면 XML 형식임을 알 수 있습니다. 모든 것을 말하면, 앱은 그것이 의미하는 바가 있다면 즉석에서 문서를 생성하고 해당 문서 및 데이터 등으로 봉투를 실시간으로 생성 할 수 있습니다. – Ergin
아래의 예에 따르면 예를 들어 DocuSign에 HTML 콘텐츠를 보내고 노력 - 콘텐츠가 PDF로 변환된다는 점에 유의하십시오. 다양한 HTML 속성의 변환 및 지원에는 표준 HTML 구성 요소의 대부분을 지원해야하지만 제한이 있습니다. –
그래, 내가 HTML 템플릿을 통과하고 그것을 PDF로 변환 할 수 있기를 바란다. –