How to add external CSS while generating PDF?

后端 未结 4 1607
广开言路
广开言路 2021-01-22 14:32

Currently i am using following code to generate PDF in a JSP file:

response.setContentType(\"application/force-download\");                                               


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-22 15:32

    i am not sure in java how can you use but in c# you can add external style sheet code or syntax by this code:-

    StyleSheet css = new StyleSheet();
        css.LoadTagStyle("body", "face", "Garamond");
        css.LoadTagStyle("body", "encoding", "Identity-H");
        css.LoadTagStyle("body", "size", "12pt");
    

    may be this helps you

    Regards, vinit

提交回复
热议问题