Okay
  Public Ticket #3594054
Feature request: Customizable Offer PDF
Closed

Comments

  •  14
    Sergio started the conversation

    Hello,

    It would be beneficial to have increased flexibility in customizing offer PDFs. 

    Enable HTML support for shortcodes like "b2bking_custom_content_after_logo_offer_pdf_left_1". 
    This would allow us to inject links to custom files attached to the offer, such as design proposal PDFs for products with customizable designs.

    Or ideal solution:

    Provide a customizable PDF template for granular control over the elements of the PDF, allowing for better presentation and additional information as needed.

    Thank you for considering this request!

  •  14
    Sergio replied

    Also, on Frontend / Offer PDF: it'd be great to be able to generate dynamic "b2bking_custom_content_after_logo_offer_pdf_left_1" for each Offer. Currently it's a global setting for all Offers.

  •  2,217
    WebWizards replied

    Hello Sergio,

    Our plugin is currently using the PDFMake library for generating PDFs. This generates the PDF files through a JS script.

    I checked that hook you mentioned: from what I can see, we are not explicitly removing HTML - I believe it must be a result of how PDFMake processes data, so unfortunately I am not sure how we could add support for it in that hook.



    While I am not sure how it would be possible to create a specific template, it is possible to do this by creating your own JS function to generate the PDF.

    I wrote a PHP code snippet that does this, which can be added to functions.php:

    https://pastecode.io/s/adcwbv72

    In this snippet, you can modify the JS function as needed. This gives you complete control over the PDF generation, content and layout.


    Kind regards,

    Stefan

  •  14
    Sergio replied

    Thank you Stefan! Yes, using own JS function will help me.

    FYI: HTML with PDFMake  https://stackoverflow.com/questions/52641260/in-pdfmake-how-to-print-html-data-from-a-string