當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript service.PdfDocumentService.downloadWithBallotPaper方法代碼示例

本文整理匯總了TypeScript中app/core/ui-services/pdf-document.service.PdfDocumentService.downloadWithBallotPaper方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.PdfDocumentService.downloadWithBallotPaper方法的具體用法?TypeScript service.PdfDocumentService.downloadWithBallotPaper怎麽用?TypeScript service.PdfDocumentService.downloadWithBallotPaper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app/core/ui-services/pdf-document.service.PdfDocumentService的用法示例。


在下文中一共展示了service.PdfDocumentService.downloadWithBallotPaper方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: printBallots

 /**
  * Triggers a pdf creation for this poll's ballots.
  * There will be 8 ballots per page.
  * Each ballot will contain:
  * - the event name and logo
  * - a first, bold line with a title. Defaults to the label Motion, the identifier,
  *   and the current number of polls for this motion (if more than one)
  * - a subtitle. A second, short (two lines, 90 characters) clarification for
  *   the ballot. Defaults to the beginning of the motion's title
  * - the options 'yes', 'no', 'abstain' translated to the client's language.
  *
  * @param motionPoll: The poll this ballot refers to
  * @param title (optional) a different title
  * @param subtitle (optional) a different subtitle
  */
 public printBallots(motionPoll: MotionPoll, title?: string, subtitle?: string): void {
     const motion = this.motionRepo.getViewModel(motionPoll.motion_id);
     const fileName = `${this.translate.instant('Motion')} - ${motion.identifier} - ${this.translate.instant(
         'ballot-paper'
     )}`;
     if (!title) {
         title = `${this.translate.instant('Motion')} - ${motion.identifier}`;
         if (motion.motion.polls.length > 1) {
             title += ` (${this.translate.instant('Vote')} ${motion.motion.polls.length})`;
         }
     }
     if (!subtitle) {
         subtitle = motion.title;
     }
     if (subtitle.length > 90) {
         subtitle = subtitle.substring(0, 90) + '...';
     }
     this.pdfService.downloadWithBallotPaper(this.getContent(title, subtitle), fileName, this.logo);
 }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:34,代碼來源:motion-poll-pdf.service.ts


注:本文中的app/core/ui-services/pdf-document.service.PdfDocumentService.downloadWithBallotPaper方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。