froala / react-froala-wysiwyg

React component for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
562 stars 130 forks source link

getPDF button not working #397

Open asadgulxar opened 3 months ago

asadgulxar commented 3 months ago

The getPDF toolbox button is not functioning properly. When I click on it, nothing happens, and the console does not display any errors. Here are my imports:


// Require Editor CSS files.
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';

// Require Editor JS files.
import 'froala-editor/js/froala_editor.pkgd.min.js';
import 'froala-editor/js/plugins.pkgd.min.js';
import 'froala-editor/js/plugins/print.min.js';

import FroalaEditorComponent from 'react-froala-wysiwyg';

my package version is "react-froala-wysiwyg": "^4.2.0"

config:


import Froalaeditor from 'froala-editor';

export const froalaEditorConfig = {
  enter: Froalaeditor.ENTER_BR,
  tableStyles: {
    'no-border': 'No border',
  },
  // language: 'ar',
  useClasses: false,
  attribution: false,
  toolbarSticky: false,
  charCounterCount: false,
  fontFamilySelection: true,
  fontSizeSelection: true,
  paragraphFormatSelection: true,
  heightMin: 200,
  // heightMax: 550,
  linkInsertButtons: [],
  toolbarButtons: [
    'paragraphFormat',
    'lineHeight',
    'align',
    'getPDF' // for pdf
    'print',
    'formatOL',
  ],
};
tvaughan73 commented 1 month ago

Docs do not make it clear at all that you need the library here for this to work. https://github.com/eKoopmans/html2pdf.js Also make sure it loads before froala or it won't work.