@ckeditor/ckeditor5-export-pdf
Version:
Export to PDF feature for CKEditor 5.
23 lines • 8.17 kB
JavaScript
/*
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
const _0x27d8e3=_0x3d0d;(function(_0x1ecfa5,_0x2898cc){const _0x1797a2=_0x3d0d,_0x326f79=_0x1ecfa5();while(!![]){try{const _0x32e833=-parseInt(_0x1797a2(0x13e))/0x1+-parseInt(_0x1797a2(0x13c))/0x2*(parseInt(_0x1797a2(0x155))/0x3)+-parseInt(_0x1797a2(0x137))/0x4+parseInt(_0x1797a2(0x126))/0x5*(-parseInt(_0x1797a2(0x133))/0x6)+parseInt(_0x1797a2(0x157))/0x7*(-parseInt(_0x1797a2(0x12b))/0x8)+-parseInt(_0x1797a2(0x134))/0x9+parseInt(_0x1797a2(0x154))/0xa;if(_0x32e833===_0x2898cc)break;else _0x326f79['push'](_0x326f79['shift']());}catch(_0x344cac){_0x326f79['push'](_0x326f79['shift']());}}}(_0xf051,0x5b727));function _0x3d0d(_0x18135c,_0xe1f593){const _0xf05143=_0xf051();return _0x3d0d=function(_0x3d0de3,_0x16b962){_0x3d0de3=_0x3d0de3-0x10c;let _0x582ec2=_0xf05143[_0x3d0de3];return _0x582ec2;},_0x3d0d(_0x18135c,_0xe1f593);}function _0xf051(){const _0x5b3b2b=['PDF\x20export\x20failed','blob','ariaLiveAnnouncer','data','config','affectsData','1290pZSjEM','6353343zGXvBb','_token','download','2371808GXRron','\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09','PDF\x20export\x20started','getDataSetValues','dataCallback','34GtCBKQ','fileName','461180Gqagxk','document.pdf','entries','status','wrapInAffixes','get','image','announce','set','Notification','\x0a\x09\x09\x09\x09\x09\x09\x09</div>\x0a\x09\x09\x09\x09\x09\x09</body>\x0a\x09\x09\x09\x09\x09</html>','createObjectURL','application/pdf','click','An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.','POST','getLabel','href','MergeFields','showWarning','stylesheets','getDefaultValues','29077590VEUOTN','18051UbcnlZ','remove','4098423kcmGVb','$defaultValues','merge_fields','getMergeFieldsIds','getMergeFieldType','editor','converterUrl','contentLanguageDirection','value','<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<title>CKEditor\x205\x20PDF\x20document</title>\x0a\x09\x09\x09\x09\x09\x09\x09<meta\x20charset=\x22utf-8\x22>\x0a\x09\x09\x09\x09\x09\x09</head>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09\x09\x09<div\x20class=\x22ck-content\x22\x20dir=\x22','https://pdf-converter.cke-cs.com/v1/convert/','URL','PDF\x20export\x20successful','isEnabled','application/json','converterOptions','ExportPdf','EDITOR_STYLES','_downloadFile','MergeFieldsEditing','then','isBusy','previewMode','appID','locale','mergeFields','has','cke5','execute','data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=','token','assertive','catch','pending','finally','function','plugins','1985HyIzoK','createElement','stringify','$labels','fetch','8FctAJy','refresh'];_0xf051=function(){return _0x5b3b2b;};return _0xf051();}import{Command as _0x49ced3}from'ckeditor5/src/core.js';import{collectStylesheets as _0xfd5da6}from'ckeditor5/src/utils.js';import{getTranslation as _0x4596a4}from'./utils/common-translations.js';export class ExportPdfCommand extends _0x49ced3{constructor(_0x43b2ed){const _0x43175e=_0x3d0d;super(_0x43b2ed),this[_0x43175e(0x146)](_0x43175e(0x116),!0x1),this[_0x43175e(0x132)]=!0x1;}[_0x27d8e3(0x12c)](){const _0x4a8107=_0x27d8e3;this[_0x4a8107(0x10e)]=!this[_0x4a8107(0x116)],this[_0x4a8107(0x15f)]=this[_0x4a8107(0x116)]?_0x4a8107(0x122):void 0x0;}[_0x27d8e3(0x11d)](_0x1040ef={}){const _0x3c4a18=_0x27d8e3,_0x63f8d4=this[_0x3c4a18(0x15c)],_0x5d2b12=_0x1040ef[_0x3c4a18(0x15d)]||_0x3c4a18(0x161),_0x5af5cd=_0x1040ef[_0x3c4a18(0x13b)]||(_0x4cf623=>_0x4cf623[_0x3c4a18(0x130)][_0x3c4a18(0x143)]()),_0x314dd8=_0x63f8d4[_0x3c4a18(0x125)][_0x3c4a18(0x143)](_0x3c4a18(0x111)),_0x2e16d0=_0x1040ef[_0x3c4a18(0x11f)]||_0x314dd8[_0x3c4a18(0x135)];return this[_0x3c4a18(0x116)]=!0x0,this[_0x3c4a18(0x12c)](),_0xfd5da6(_0x1040ef[_0x3c4a18(0x152)]||[_0x3c4a18(0x112)])[_0x3c4a18(0x115)](async _0x26c0af=>{const _0x12b9ce=_0x3c4a18;if(_0x63f8d4['ui'][_0x12b9ce(0x12f)][_0x12b9ce(0x145)](_0x4596a4(_0x63f8d4[_0x12b9ce(0x119)],_0x12b9ce(0x139))),_0x63f8d4[_0x12b9ce(0x125)][_0x12b9ce(0x11b)](_0x12b9ce(0x150))){_0x1040ef[_0x12b9ce(0x110)]||(_0x1040ef[_0x12b9ce(0x110)]={});const _0x26b5c4=_0x63f8d4[_0x12b9ce(0x125)][_0x12b9ce(0x143)](_0x12b9ce(0x114)),_0x5bcf29=_0x26b5c4[_0x12b9ce(0x117)],{prefix:_0x1d28b6,suffix:_0x1b1bba}=_0x63f8d4[_0x12b9ce(0x131)][_0x12b9ce(0x143)](_0x12b9ce(0x11a)),_0x2aedc0=_0x12b9ce(0x11e),_0x1afae1={'prefix':_0x1d28b6,'suffix':_0x1b1bba,'data':{}};if(_0x12b9ce(0x129)===_0x5bcf29){for(const _0x5d02d0 of _0x26b5c4[_0x12b9ce(0x15a)]())_0x12b9ce(0x144)===_0x26b5c4[_0x12b9ce(0x15b)](_0x5d02d0)?_0x1afae1[_0x12b9ce(0x130)][_0x5d02d0]=_0x2aedc0:_0x1afae1[_0x12b9ce(0x130)][_0x5d02d0]=_0x26b5c4[_0x12b9ce(0x142)](_0x26b5c4[_0x12b9ce(0x14e)](_0x5d02d0)||_0x5d02d0);}else{const _0x262a81=_0x12b9ce(0x158)===_0x5bcf29?_0x26b5c4[_0x12b9ce(0x153)]():_0x26b5c4[_0x12b9ce(0x13a)](_0x5bcf29,!0x0);for(const _0x2f04d7 of Object[_0x12b9ce(0x140)](_0x262a81)){const [_0x21cd3c,_0x4c1304]=_0x2f04d7;_0x12b9ce(0x144)===_0x26b5c4[_0x12b9ce(0x15b)](_0x21cd3c)?_0x1afae1[_0x12b9ce(0x130)][_0x21cd3c]=null!==_0x4c1304?_0x4c1304:_0x2aedc0:_0x1afae1[_0x12b9ce(0x130)][_0x21cd3c]=null!==_0x4c1304?_0x4c1304:_0x26b5c4[_0x12b9ce(0x14e)](_0x21cd3c)||_0x21cd3c;}}_0x1040ef[_0x12b9ce(0x110)][_0x12b9ce(0x159)]=_0x1afae1;}const _0x233e37={'html':_0x12b9ce(0x160)+_0x63f8d4[_0x12b9ce(0x119)][_0x12b9ce(0x15e)]+_0x12b9ce(0x138)+await _0x5af5cd(_0x63f8d4)+_0x12b9ce(0x148),'css':_0x26c0af,'options':_0x1040ef[_0x12b9ce(0x110)]},_0x4eff41={'method':_0x12b9ce(0x14d),'headers':{'Content-Type':_0x12b9ce(0x10f),'Accept':_0x12b9ce(0x14a),..._0x2e16d0?{'Authorization':_0x2e16d0[_0x12b9ce(0x15f)]}:null,'x-cs-app-id':_0x1040ef[_0x12b9ce(0x118)]||_0x12b9ce(0x11c)},'body':JSON[_0x12b9ce(0x128)](_0x233e37)};return window[_0x12b9ce(0x12a)](_0x5d2b12,_0x4eff41)[_0x12b9ce(0x115)](_0x590e4e=>{const _0x271edc=_0x12b9ce;if(0xc8!==_0x590e4e[_0x271edc(0x141)])throw _0x590e4e;return _0x590e4e[_0x271edc(0x12e)]();})[_0x12b9ce(0x115)](_0x259a85=>{const _0x35afe3=_0x12b9ce;_0x63f8d4['ui'][_0x35afe3(0x12f)][_0x35afe3(0x145)](_0x4596a4(_0x63f8d4[_0x35afe3(0x119)],_0x35afe3(0x10d)));const _0x1f2aa4=_0x35afe3(0x124)==typeof _0x1040ef[_0x35afe3(0x13d)]?_0x1040ef[_0x35afe3(0x13d)]():_0x1040ef[_0x35afe3(0x13d)];this[_0x35afe3(0x113)](_0x259a85,_0x1f2aa4||_0x35afe3(0x13f));});})[_0x3c4a18(0x121)](_0x5c7bb0=>{const _0x28ae9b=_0x3c4a18,_0x232752=_0x63f8d4[_0x28ae9b(0x125)][_0x28ae9b(0x143)](_0x28ae9b(0x147));throw _0x63f8d4['ui'][_0x28ae9b(0x12f)][_0x28ae9b(0x145)](_0x4596a4(_0x63f8d4[_0x28ae9b(0x119)],_0x28ae9b(0x12d)),{'politeness':_0x28ae9b(0x120)}),_0x232752[_0x28ae9b(0x151)](_0x4596a4(_0x63f8d4[_0x28ae9b(0x119)],_0x28ae9b(0x14c))),_0x5c7bb0;})[_0x3c4a18(0x123)](()=>{const _0x137e58=_0x3c4a18;this[_0x137e58(0x116)]=!0x1,this[_0x137e58(0x12c)]();});}[_0x27d8e3(0x113)](_0x375306,_0x2a5bf3){const _0x4ee498=_0x27d8e3,_0x4c5ab4=document[_0x4ee498(0x127)]('a');_0x4c5ab4[_0x4ee498(0x14f)]=window[_0x4ee498(0x10c)][_0x4ee498(0x149)](_0x375306),_0x4c5ab4[_0x4ee498(0x136)]=_0x2a5bf3,_0x4c5ab4[_0x4ee498(0x14b)](),_0x4c5ab4[_0x4ee498(0x156)]();}}