Could you try below approach and let me know if meets your requirement,
1)On click of button add a click event with action OpenURLinWindow and call an Activity(Say Act1) 2) Add your section within a HTML rule as "<pega:include name="YouSectionName" type="Rule-HTML-Section"/>"
3) Use the HTML rule as the "StreamName" parameter while calling the activity "HTMLToPDF" in your activity(ACT1).
4) pass "<<RequiredPDFName>>.pdf" as parameter to Param.PDFName for .view activity
you can use pyViewAsPDF activity for your requirement.