Are there any best practices for avoiding inline styles in HTML output when using CKeditor for PDF conversion?

When using CKeditor for PDF conversion, it is best to avoid inline styles in the HTML output to ensure clean and maintainable code. One way to achieve this is by using CSS classes instead of inline styles for styling elements. By defining CSS classes in an external stylesheet and applying them to elements in the CKeditor content, you can separate style from content and improve the overall structure of the HTML output.

// Define a custom CSS file to be used in CKeditor
function custom_editor_styles() {
    add_editor_style( 'custom-editor-styles.css' );
}
add_action( 'admin_init', 'custom_editor_styles' );