Support » Plugin: Send PDF for Contact Form 7 » CSS, Fonts, etc. INFORMATION/DOCUMENTATION

  • Resolved mdp716

    (@mdp716)


    These comments refer to version 0.5.9 of this plug-in.

    Firstly, thank you to Florent Maillefaud for creating this plug-in. It is, in my opinion, desperately needed for those of us on very limited budgets (non-profits, etc.).

    I have spent a LOT of time trying to figure out how to collect a few simple values in a Form and then use those to populate a Waiver form that literally fills a page with legalese so once I installed the plug-in and gave it a quick test I then turned to creating that form within this Plug-in’s design. I thought that would be easy but not knowing mPDF (which is what this plug-in uses) or much about WP plug-ins I found myself spending a lot of time trying to figure out why using CSS in a defined head section of HTML would not work.

    Another thing which has consumed my time is to discover what fonts are available out of the box with mPDF.

    So firstly I learned that CSS in a head section of HTML is apparently ineffective so you would either have to use in-line HTML styling or in-line CSS. However, there are only a subset of CSS and HTML tags that mPDF recognizes.

    Therefore, finding and reading the mPDF documentation is important if you truly want to understand what is possible. THere is an online copy here: https://mpdf.github.io/

    It would appear that using the CSS tag FONT is the best option as you can assemble all of the font related CSS tags in a single line. For documentation on that I suggest here: https://www.w3schools.com/cssref/pr_font_font.asp

    Lastly, I was not really able wholly figure out what fonts were available with the version of mPDF (version 6.0 is packaged with this plug-in and 6.1 is the latest version of mPDF as of this writing). It would appear that it is easily possible to add or remove fonts in mPDF so the bigger question is what comes configured with the version in this plug-in. Knowing that list would be nice.

    However, including or using a font in mPDF that is outside of the default set for PDF documents as a whole is not a wise idea unless you have a specific reason for it because whomever is going to open that PDF document needs to have the same or a comparable font on their computer in order to see the document exactly as you see it. If the client computer does not have the specific font you used then your PDF reader will substitute a font that it thinks is the closest to what was intended. Adobe Reader will warn you that it is doing this for a font you do not have which was called in the PDF document.

    Therefore, using the default font set for PDF is the best choice and a list of that set is available here: http://www.enfocus.com/manuals/ReferenceGuide/PP/10/enUS/en-us/concept/c_aa1140975.html

    Finally, while I have been in the I.T. industry for a long time, I managed to not have to learn very much HTML, CSS, PHP, javascript, or WordPress in all those years so I am on a very steep learning curve here. Therefore, if anything I said is incorrect, please correct me for others who seek the same more or less basic details that I have been on a quest for (and not having much success).

    As a suggestion to the developer of this plug-in, it seems, from what I can figure out, that you are using mPDF in mode 2, or at least the editor you provide users with is effectively in mode 2. This means that creating a STYLE section in that editor is not recognized and it took me a while to figure that out. It appears that the editor currently only supports what would typically be put between the opening and closing BODY tags.

    Would it be possible to either provide the option to select an external CSS file and/or provide a separate editor window for the CSS which you would then insert in the HEAD section?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘CSS, Fonts, etc. INFORMATION/DOCUMENTATION’ is closed to new replies.