• Resolved bggg12

    (@bggg12)


    Hi,
    I have three questions:

    – how can I use an svg logo for the invoices? In the PDF it is not diplayed, whereas it is displayed if set the PDF to be displayed as HTML in the settings…
    – I have very long product titles and have added &shy into these (for mobile) but now on the invoices the product names actually have hyphenation even when there is no line break…
    – I don’t completely understand how I can create my own css/adapt the existing when using the HTML option instead of the PDF…the HTML does not apply all the css so it just looks like text going across the whole screen. But when using the PDF, you can’t use dev tools or Firebug.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! Conversion from HTML to PDF is unfortunately not as fully featured as browser display. We use the dompdf library which is quite solid but as you found out does have its own rules and limitations.

    • SVG is supported, but gradient support is very limited.
    • Soft hyphens are currently not support (github issue here)
    • If PDF is your end goal, you will need to work with the PDF. I personally do most tweaking in HTML mode and then see if it needs adjustments after seeing the PDF result. Most traditional CSS works as expected, just the positioning sometimes works a little differently. You could keep 2 tabs with the same document open, one with &output=html and the other without, and then use dev tools to fiddle with the elements and find the required selectors and then apply that CSS in your template and refresh the browser tab with the PDF to see the result.

    As a workaround for the ­ issue you could use a script to remove it from the PDF entirely:

    
    add_filter( 'wpo_wcpdf_get_html', 'wpo_wcpdf_replace_characters', 10, 2);
    function wpo_wcpdf_replace_characters( $html, $document ) {
    	$html = str_replace( array( '­', html_entity_decode( '­' ) ), '', $html);
    	return $html;
    }
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Thread Starter bggg12

    (@bggg12)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘SVG logo/hyphenation/HTML’ is closed to new replies.