@ckeditor/ckeditor5-export-pdf
Version:
Export to PDF feature for CKEditor 5.
23 lines • 9.21 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 _0x4a4522=_0x114c;(function(_0x48df89,_0x10b511){const _0xa81f7b=_0x114c,_0x3474c3=_0x48df89();while(!![]){try{const _0xe36004=-parseInt(_0xa81f7b(0xeb))/0x1+-parseInt(_0xa81f7b(0xae))/0x2+parseInt(_0xa81f7b(0xba))/0x3*(parseInt(_0xa81f7b(0xee))/0x4)+parseInt(_0xa81f7b(0xd5))/0x5+parseInt(_0xa81f7b(0xf5))/0x6+parseInt(_0xa81f7b(0xf4))/0x7*(parseInt(_0xa81f7b(0xc2))/0x8)+-parseInt(_0xa81f7b(0xbb))/0x9;if(_0xe36004===_0x10b511)break;else _0x3474c3['push'](_0x3474c3['shift']());}catch(_0x312474){_0x3474c3['push'](_0x3474c3['shift']());}}}(_0x1d36,0x42fef));import{Command as _0x2d003a}from'ckeditor5/src/core.js';import{collectStylesheets as _0x5514a4}from'ckeditor5/src/utils.js';function _0x1d36(){const _0x2be988=['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','\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09','value','$defaultValues','\x22\x20style=\x22','isBusy','click','isEnabled','previewMode','createObjectURL','data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=','2694EVLzDR','5197878dJsgGU','getMergeFieldsIds','PDF\x20export\x20started','data','margin_left','59.4cm','join','2712HrmPpN','getDataSetValues','margin_right','refresh','PDF\x20export\x20failed','An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.','getDefaultValues','\x0a\x09\x09\x09\x09\x09\x09\x09</div>\x0a\x09\x09\x09\x09\x09\x09</body>\x0a\x09\x09\x09\x09\x09</html>\x0a\x09\x09\x09\x09','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','\x0a\x09\x09\x09\x09\x09<!DOCTYPE\x20html>\x0a\x09\x09\x09\x09\x09<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','URL','PDF\x20export\x20successful','contentLanguageDirection','width:calc(','113048POfBdD','catch','ariaLiveAnnouncer','128CirmNJ','POST','href','\x20-\x20','$labels','27.9cm','8071mLTypU','1539522eknAUA','https://pdf-converter.cke-cs.com/v1/convert/','application/json'];_0x1d36=function(){return _0x2be988;};return _0x1d36();}import{getTranslation as _0xcc39f7}from'./utils/common-translations.js';function _0x114c(_0x5b3876,_0x1971c1){const _0x1d3680=_0x1d36();return _0x114c=function(_0x114cc5,_0x52df8b){_0x114cc5=_0x114cc5-0xa3;let _0x3812fc=_0x1d3680[_0x114cc5];return _0x3812fc;},_0x114c(_0x5b3876,_0x1971c1);}export class ExportPdfCommand extends _0x2d003a{constructor(_0xbb9f68){const _0x385dff=_0x114c;super(_0xbb9f68),this[_0x385dff(0xe2)](_0x385dff(0xb4),!0x1),this[_0x385dff(0x107)]=!0x1;}[_0x4a4522(0xc5)](){const _0x43b6a5=_0x4a4522;this[_0x43b6a5(0xb6)]=!this[_0x43b6a5(0xb4)],this[_0x43b6a5(0xb1)]=this[_0x43b6a5(0xb4)]?_0x43b6a5(0xdd):void 0x0;}[_0x4a4522(0xd9)](_0x598843={}){const _0x12063c=_0x4a4522,_0x149fb9=this[_0x12063c(0xd8)],_0x3f1f4f=_0x598843[_0x12063c(0xdf)]||_0x12063c(0xf6),_0x2bc6e2=_0x598843[_0x12063c(0xcc)]||(_0x5b1ba1=>_0x5b1ba1[_0x12063c(0xbe)][_0x12063c(0xad)]()),_0x2091a8=_0x149fb9[_0x12063c(0xa9)][_0x12063c(0xad)](_0x12063c(0xa4)),_0x539899=_0x598843[_0x12063c(0xca)]||_0x2091a8[_0x12063c(0xab)];return this[_0x12063c(0xb4)]=!0x0,this[_0x12063c(0xc5)](),_0x5514a4(_0x598843[_0x12063c(0x10c)]||[_0x12063c(0xe5)])[_0x12063c(0x105)](async _0x200aec=>{const _0x5836b0=_0x12063c;if(_0x149fb9['ui'][_0x5836b0(0xed)][_0x5836b0(0xa5)](_0xcc39f7(_0x149fb9[_0x5836b0(0xcd)],_0x5836b0(0xbd))),_0x149fb9[_0x5836b0(0xa9)][_0x5836b0(0xe1)](_0x5836b0(0xaf))){_0x598843[_0x5836b0(0xe4)]||(_0x598843[_0x5836b0(0xe4)]={});const _0x1e77b8=_0x149fb9[_0x5836b0(0xa9)][_0x5836b0(0xad)](_0x5836b0(0xa3)),_0x53a512=_0x1e77b8[_0x5836b0(0xb7)],{prefix:_0x9c8513,suffix:_0x364c51}=_0x149fb9[_0x5836b0(0xe0)][_0x5836b0(0xad)](_0x5836b0(0xcb)),_0x451d84=_0x5836b0(0xb9),_0x7750af={'prefix':_0x9c8513,'suffix':_0x364c51,'data':{}};if(_0x5836b0(0xf2)===_0x53a512){for(const _0xaf2b05 of _0x1e77b8[_0x5836b0(0xbc)]())_0x5836b0(0xd0)===_0x1e77b8[_0x5836b0(0xce)](_0xaf2b05)?_0x7750af[_0x5836b0(0xbe)][_0xaf2b05]=_0x451d84:_0x7750af[_0x5836b0(0xbe)][_0xaf2b05]=_0x1e77b8[_0x5836b0(0x10a)](_0x1e77b8[_0x5836b0(0x104)](_0xaf2b05)||_0xaf2b05);}else{const _0x32436b=_0x5836b0(0xb2)===_0x53a512?_0x1e77b8[_0x5836b0(0xc8)]():_0x1e77b8[_0x5836b0(0xc3)](_0x53a512,!0x0);for(const _0x228c93 of Object[_0x5836b0(0xaa)](_0x32436b)){const [_0x1dfe58,_0x4d5527]=_0x228c93;_0x5836b0(0xd0)===_0x1e77b8[_0x5836b0(0xce)](_0x1dfe58)?_0x7750af[_0x5836b0(0xbe)][_0x1dfe58]=null!==_0x4d5527?_0x4d5527:_0x451d84:_0x7750af[_0x5836b0(0xbe)][_0x1dfe58]=null!==_0x4d5527?_0x4d5527:_0x1e77b8[_0x5836b0(0x104)](_0x1dfe58)||_0x1dfe58;}}_0x598843[_0x5836b0(0xe4)][_0x5836b0(0x100)]=_0x7750af;}const _0x313bbe=function(_0x4c6b88){const _0x2118a8=_0x5836b0,_0x102914=(_0x4186f2=_0x4c6b88?.[_0x2118a8(0xd2)]||'A4',{'letter':[_0x2118a8(0xda),_0x2118a8(0xf3)],'legal':[_0x2118a8(0xda),_0x2118a8(0x102)],'tabloid':[_0x2118a8(0xf3),_0x2118a8(0x106)],'ledger':[_0x2118a8(0x106),_0x2118a8(0xf3)],'a0':[_0x2118a8(0xe3),_0x2118a8(0xff)],'a1':[_0x2118a8(0xc0),_0x2118a8(0xe3)],'a2':[_0x2118a8(0xfc),_0x2118a8(0xc0)],'a3':[_0x2118a8(0xd4),_0x2118a8(0xfc)],'a4':[_0x2118a8(0xd1),_0x2118a8(0xd4)],'a5':[_0x2118a8(0xfe),_0x2118a8(0xd1)],'a6':[_0x2118a8(0xa8),_0x2118a8(0xfe)]}[_0x4186f2[_0x2118a8(0xf9)]()][0x0]),_0x2904d8=_0x4c6b88?.[_0x2118a8(0xbf)],_0x143e1c=_0x4c6b88?.[_0x2118a8(0xc4)];var _0x4186f2;return _0x2118a8(0xea)+[_0x102914,..._0x2904d8?[_0x2904d8]:[],..._0x143e1c?[_0x143e1c]:[]][_0x2118a8(0xc1)](_0x2118a8(0xf1))+');';}(_0x598843[_0x5836b0(0xe4)]),_0x12e163={'html':(_0x5836b0(0xe6)+_0x149fb9[_0x5836b0(0xcd)][_0x5836b0(0xe9)]+_0x5836b0(0xb3)+_0x313bbe+_0x5836b0(0xb0)+await _0x2bc6e2(_0x149fb9)+_0x5836b0(0xc9))[_0x5836b0(0x101)](),'css':_0x200aec,'options':_0x598843[_0x5836b0(0xe4)]},_0x2a4780={'method':_0x5836b0(0xef),'headers':{'Content-Type':_0x5836b0(0xf7),'Accept':_0x5836b0(0xf8),..._0x539899?{'Authorization':_0x539899[_0x5836b0(0xb1)]}:null,'x-cs-app-id':_0x598843[_0x5836b0(0xfd)]||_0x5836b0(0xd6)},'body':JSON[_0x5836b0(0xa7)](_0x12e163)};return window[_0x5836b0(0xde)](_0x3f1f4f,_0x2a4780)[_0x5836b0(0x105)](_0x173a26=>{const _0x5920b8=_0x5836b0;if(0xc8!==_0x173a26[_0x5920b8(0xd7)])throw _0x173a26;return _0x173a26[_0x5920b8(0xcf)]();})[_0x5836b0(0x105)](_0x285342=>{const _0x9eaab1=_0x5836b0;_0x149fb9['ui'][_0x9eaab1(0xed)][_0x9eaab1(0xa5)](_0xcc39f7(_0x149fb9[_0x9eaab1(0xcd)],_0x9eaab1(0xe8)));const _0x5e33bb=_0x9eaab1(0x109)==typeof _0x598843[_0x9eaab1(0xdb)]?_0x598843[_0x9eaab1(0xdb)]():_0x598843[_0x9eaab1(0xdb)];this[_0x9eaab1(0xa6)](_0x285342,_0x5e33bb||_0x9eaab1(0xd3));});})[_0x12063c(0xec)](_0x5b7e9c=>{const _0x28af74=_0x12063c,_0x1827a6=_0x149fb9[_0x28af74(0xa9)][_0x28af74(0xad)](_0x28af74(0x103));throw _0x149fb9['ui'][_0x28af74(0xed)][_0x28af74(0xa5)](_0xcc39f7(_0x149fb9[_0x28af74(0xcd)],_0x28af74(0xc6)),{'politeness':_0x28af74(0xac)}),_0x1827a6[_0x28af74(0x10b)](_0xcc39f7(_0x149fb9[_0x28af74(0xcd)],_0x28af74(0xc7))),_0x5b7e9c;})[_0x12063c(0xfa)](()=>{const _0x3ad313=_0x12063c;this[_0x3ad313(0xb4)]=!0x1,this[_0x3ad313(0xc5)]();});}[_0x4a4522(0xa6)](_0x533fcf,_0x31a57c){const _0x51dd27=_0x4a4522,_0x3cb239=document[_0x51dd27(0x108)]('a');_0x3cb239[_0x51dd27(0xf0)]=window[_0x51dd27(0xe7)][_0x51dd27(0xb8)](_0x533fcf),_0x3cb239[_0x51dd27(0xfb)]=_0x31a57c,_0x3cb239[_0x51dd27(0xb5)](),_0x3cb239[_0x51dd27(0xdc)]();}}