mittwald / typo3-web2pdf

A TYPO3 extension for rendering content as PDF
GNU General Public License v2.0
18 stars 20 forks source link

Update Documentation #13

Closed kpurrmann closed 4 years ago

DavidBruchmann commented 7 years ago

Example for pdfPregSearch and pdfPregReplace:

plugin.tx_web2pdf.settings {
    pdfPregSearch {
        1 = /^(.*)<!--TYPO3SEARCH_begin-->(.*)<!--TYPO3SEARCH_end-->(.*)$/s
    }
    pdfPregReplace {
        1 = $2
    }
}

Without these settings images never have been found (in TYPO3 6.2) but shown as red squares after these settings content is shown really nice and images are shown like on the website.

DavidBruchmann commented 7 years ago

If the website includes several areas wrapped with "<!--TYPO3SEARCH_begin-->|<!--TYPO3SEARCH_end-->", then the expression above is not working and had to be adjusted individually.

DavidBruchmann commented 7 years ago

To refine several parts wrapped with "<!--TYPO3SEARCH_begin-->|<!--TYPO3SEARCH_end-->" this setting can be used (explanation as comments):

plugin.tx_web2pdf.settings {
    pdfPregSearch {
        # getting all content between the first "<!--TYPO3SEARCH_begin-->" and the last "<!--TYPO3SEARCH_end-->"
        1 = /^(.*)<!--TYPO3SEARCH_begin-->(.*)<!--TYPO3SEARCH_end-->(.*)$/s
        # filtering all between the search-parts
        2 = /<!--TYPO3SEARCH_end-->(.*?)?<!--TYPO3SEARCH_begin-->/s
    }
    pdfPregReplace {
        1 = $2
        2 = $1
    }
}

This solution should work even only with one search part "<!--TYPO3SEARCH_begin--> ... <!--TYPO3SEARCH_end-->" but executes then needless the second regular search.

pstranghoener commented 6 years ago

Sorry for the delay could you make a PR for the documentation?

Thanks Philipp