@ckeditor/ckeditor5-export-pdf
Version:
Export to PDF feature for CKEditor 5.
5 lines • 9.97 kB
JavaScript
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"An error occurred while generating the PDF.":"An error occurred while generating the PDF.","Export to PDF":"Export to PDF","Exporting PDF document":"Exporting PDF document","PDF export failed":"PDF export failed","PDF export started":"PDF export started","PDF export successful":"PDF export successful"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
/*!
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(()=>{var t={237:t=>{"use strict";t.exports=CKEditor5.dll},311:(t,e,n)=>{t.exports=n(237)("./src/ui.js")},355:(t,e,n)=>{t.exports=n(237)("./src/icons.js")},584:(t,e,n)=>{t.exports=n(237)("./src/utils.js")},782:(t,e,n)=>{t.exports=n(237)("./src/core.js")}},e={};function n(r){var s=e[r];if(void 0!==s)return s.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{ExportPdf:()=>x,ExportPdfCommand:()=>u});var t=n(782),e=n(311),s=n(584);function o(t,e){const n=t.t;switch(e){case"Export to PDF":return n("Export to PDF");case"An error occurred while generating the PDF.":return n("An error occurred while generating the PDF.");case"PDF export started":return n("PDF export started");case"PDF export failed":return n("PDF export failed");case"PDF export successful":return n("PDF export successful");case"Exporting PDF document":return n("Exporting PDF document");default:return e}}const i=a;function c(){const t=["application/pdf","toLowerCase","finally","download","42.0cm","appID","14.8cm","118.9cm","merge_fields","trim","35.6cm","Notification","getLabel","then","43.2cm","affectsData","createElement","function","wrapInAffixes","showWarning","stylesheets","MergeFieldsEditing","ExportPdf","announce","_downloadFile","stringify","10.5cm","plugins","entries","_token","assertive","get","268326aRIEsx","MergeFields",'">\n\t\t\t\t\t\t\t\t',"value","$defaultValues",'" style="',"isBusy","click","isEnabled","previewMode","createObjectURL","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","2694EVLzDR","5197878dJsgGU","getMergeFieldsIds","PDF export started","data","margin_left","59.4cm","join","2712HrmPpN","getDataSetValues","margin_right","refresh","PDF export failed","An error occurred while generating the PDF.","getDefaultValues","\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</body>\n\t\t\t\t\t</html>\n\t\t\t\t","token","mergeFields","dataCallback","locale","getMergeFieldType","blob","image","21.0cm","format","document.pdf","29.7cm","2114890EjlzbF","cke5","status","editor","execute","21.6cm","fileName","remove","pending","fetch","converterUrl","config","has","set","84.1cm","converterOptions","EDITOR_STYLES",'\n\t\t\t\t\t<!DOCTYPE html>\n\t\t\t\t\t<html>\n\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<title>CKEditor 5 PDF document</title>\n\t\t\t\t\t\t\t<meta charset="utf-8">\n\t\t\t\t\t\t</head>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t<div class="ck-content" dir="',"URL","PDF export successful","contentLanguageDirection","width:calc(","113048POfBdD","catch","ariaLiveAnnouncer","128CirmNJ","POST","href"," - ","$labels","27.9cm","8071mLTypU","1539522eknAUA","https://pdf-converter.cke-cs.com/v1/convert/","application/json"];return(c=function(){return t})()}function a(t,e){const n=c();return(a=function(t,e){return n[t-=163]})(t,e)}!function(t){const e=a,n=t();for(;;)try{if(274415===-parseInt(e(235))/1+-parseInt(e(174))/2+parseInt(e(186))/3*(parseInt(e(238))/4)+parseInt(e(213))/5+parseInt(e(245))/6+parseInt(e(244))/7*(parseInt(e(194))/8)+-parseInt(e(187))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(c);class u extends t.Command{constructor(t){const e=a;super(t),this[e(226)](e(180),!1),this[e(263)]=!1}[i(197)](){const t=i;this[t(182)]=!this[t(180)],this[t(177)]=this[t(180)]?t(221):void 0}[i(217)](t={}){const e=i,n=this[e(216)],r=t[e(223)]||e(246),c=t[e(204)]||(t=>t[e(190)][e(173)]()),a=n[e(169)][e(173)](e(164)),u=t[e(202)]||a[e(171)];return this[e(180)]=!0,this[e(197)](),(0,s.collectStylesheets)(t[e(268)]||[e(229)])[e(261)](async s=>{const i=e;if(n.ui[i(237)][i(165)](o(n[i(205)],i(189))),n[i(169)][i(225)](i(175))){t[i(228)]||(t[i(228)]={});const e=n[i(169)][i(173)](i(163)),r=e[i(183)],{prefix:s,suffix:o}=n[i(224)][i(173)](i(203)),c=i(185),a={prefix:s,suffix:o,data:{}};if(i(242)===r)for(const t of e[i(188)]())i(208)===e[i(206)](t)?a[i(190)][t]=c:a[i(190)][t]=e[i(266)](e[i(260)](t)||t);else{const t=i(178)===r?e[i(200)]():e[i(195)](r,!0);for(const n of Object[i(170)](t)){const[t,r]=n;i(208)===e[i(206)](t)?a[i(190)][t]=null!==r?r:c:a[i(190)][t]=null!==r?r:e[i(260)](t)||t}}t[i(228)][i(256)]=a}const a=function(t){const e=i,n=(o=t?.[e(210)]||"A4",{letter:[e(218),e(243)],legal:[e(218),e(258)],tabloid:[e(243),e(262)],ledger:[e(262),e(243)],a0:[e(227),e(255)],a1:[e(192),e(227)],a2:[e(252),e(192)],a3:[e(212),e(252)],a4:[e(209),e(212)],a5:[e(254),e(209)],a6:[e(168),e(254)]}[o[e(249)]()][0]),r=t?.[e(191)],s=t?.[e(196)];var o;return e(234)+[n,...r?[r]:[],...s?[s]:[]][e(193)](e(241))+");"}(t[i(228)]),p={html:(i(230)+n[i(205)][i(233)]+i(179)+a+i(176)+await c(n)+i(201))[i(257)](),css:s,options:t[i(228)]},l={method:i(239),headers:{"Content-Type":i(247),Accept:i(248),...u?{Authorization:u[i(177)]}:null,"x-cs-app-id":t[i(253)]||i(214)},body:JSON[i(167)](p)};return window[i(222)](r,l)[i(261)](t=>{const e=i;if(200!==t[e(215)])throw t;return t[e(207)]()})[i(261)](e=>{const r=i;n.ui[r(237)][r(165)](o(n[r(205)],r(232)));const s=r(265)==typeof t[r(219)]?t[r(219)]():t[r(219)];this[r(166)](e,s||r(211))})})[e(236)](t=>{const r=e,s=n[r(169)][r(173)](r(259));throw n.ui[r(237)][r(165)](o(n[r(205)],r(198)),{politeness:r(172)}),s[r(267)](o(n[r(205)],r(199))),t})[e(250)](()=>{const t=e;this[t(180)]=!1,this[t(197)]()})}[i(166)](t,e){const n=i,r=document[n(264)]("a");r[n(240)]=window[n(231)][n(184)](t),r[n(251)]=e,r[n(181)](),r[n(220)]()}}var p=n(355);const l=f;function d(){const t=["Export to PDF","624930wuKNCw","iconView","children","3457279PseDbX","get","exportPdf","bind","isOn","focus","editor","Exporting PDF document","editing","24jycseD","init","componentFactory","4102278dXNoAA","42591870SEoIXt","locale","isPremiumPlugin","ExportPdfUI","label","commands","4oqbQyB","listenTo","pluginName","add","menuBar:exportPdf","6944214DAnYmW","_createButton","isOfficialPlugin","view","set","execute","isVisible","611430DEHrOe","isBusy","isEnabled","1005156nCrplW","config"];return(d=function(){return t})()}function f(t,e){const n=d();return(f=function(t,e){return n[t-=402]})(t,e)}!function(t){const e=f,n=t();for(;;)try{if(742078===-parseInt(e(406))/1+parseInt(e(409))/2+-parseInt(e(427))/3*(parseInt(e(434))/4)+parseInt(e(412))/5+-parseInt(e(439))/6+parseInt(e(415))/7*(-parseInt(e(424))/8)+parseInt(e(428))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(d);class h extends t.Plugin{static get[l(436)](){return l(431)}static get[l(441)](){return!0}static get[l(430)](){return!0}[l(425)](){const t=l,n=this[t(421)];n.ui[t(426)][t(437)](t(417),()=>{const r=t,s=this[r(440)](e.ButtonView),o=n[r(433)][r(416)](r(417));return s[r(403)]({tooltip:!0}),s[r(418)](r(419)).to(o,r(407)),s}),n.ui[t(426)][t(437)](t(438),()=>this[t(440)](e.MenuBarMenuListItemButtonView))}[l(440)](t){const n=l,r=this[n(421)],s=r[n(410)][n(416)](n(417))||{},i=r[n(433)][n(416)](n(417)),c=new t(r[n(429)]),a=new e.SpinnerView;return c[n(414)][n(437)](a),a[n(418)](n(405)).to(i,n(407)),c[n(413)][n(418)](n(405)).to(i,n(407),t=>!t),c[n(403)]({icon:p.IconExportPdf}),c[n(418)](n(408)).to(i,n(408)),c[n(418)](n(432)).to(i,n(407),t=>o(r[n(429)],n(t?422:411))),this[n(435)](c,n(404),()=>{const t=n;r[t(404)](t(417),s),r[t(423)][t(402)][t(420)]()}),c}}const g=m;function m(t,e){const n=P();return(m=function(t,e){return n[t-=468]})(t,e)}!function(t){const e=m,n=t();for(;;)try{if(246711===parseInt(e(479))/1*(-parseInt(e(489))/2)+parseInt(e(474))/3*(parseInt(e(475))/4)+parseInt(e(484))/5+parseInt(e(487))/6+parseInt(e(493))/7+-parseInt(e(492))/8*(parseInt(e(483))/9)+-parseInt(e(477))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(P);class x extends t.Plugin{[g(496)];static get[g(480)](){return g(482)}static get[g(478)](){return!0}static get[g(485)](){return!0}static get[g(490)](){return[g(471),e.Notification,h]}[g(481)](){const t=g,e=this[t(495)],n=e[t(494)][t(488)](t(476))||{};e[t(473)][t(470)](t(476),new u(e));const r=e[t(468)][t(488)](t(471));!1===n[t(486)]?this[t(496)]=null:n[t(486)]?r[t(491)](n[t(486)])[t(472)](e=>{this[t(496)]=e}):this[t(496)]=r[t(469)]}}function P(){const t=["1522010tYgqcY","isPremiumPlugin","tokenUrl","1011402yCyuUW","get","36tyUZlx","requires","registerTokenUrl","8eYEzfM","3212363UySdXw","config","editor","_token","plugins","token","add","CloudServices","then","commands","316578bvvIZn","16bADntq","exportPdf","8205760HIUTLB","isOfficialPlugin","1409rmoyHv","pluginName","init","ExportPdf","2351997JsagMv"];return(P=function(){return t})()}function I(t,e){var n=A();return(I=function(t,e){return n[t-=299]})(t,e)}function A(){var t=["3306zyhvBc","10loZgQs","4718505vxqwxV","67446yUAWgR","342ipvunI","4184bhvLyR","259sJvSMe","182460QQEwAS","10FUOMkf","20274xpKmPE","419476qKaKgT"];return(A=function(){return t})()}!function(t){for(var e=I,n=t();;)try{if(104913===-parseInt(e(299))/1+-parseInt(e(304))/2+-parseInt(e(308))/3+-parseInt(e(300))/4*(parseInt(e(302))/5)+parseInt(e(301))/6*(parseInt(e(307))/7)+parseInt(e(306))/8*(-parseInt(e(305))/9)+-parseInt(e(309))/10*(-parseInt(e(303))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(A)})(),(window.CKEditor5=window.CKEditor5||{}).exportPdf=r})();