How to generate a PDF using section as input with same formatting
Solution:
Create a html rule with below code
<head> <link rel="stylesheet" href="webwb/pxCompactStylesforPDF.css"> <br /> <pega:include name="xxxxx1" type="Rule-HTML-Section" /> <br /> <pega:include name="xxxxx2" type="Rule-HTML-Section" /> </head>
create a activity add a step to do property set for setting Param.FileName,
then in next step call pyViewAsPDf pass html rule name and file name as params.
Call this activity on a button add action->OPen url in new window
params: enable use page check box
add above activity name
add windowname as _self