aspose pdf java版本-->11.8
我尝试使用headerfooter类将标题添加到pdf文件的每个页面。下面是代码,
is——这个变量流包含html的流内容。
htmloptions—用于设置生成文件的页边距。
Document pdfDocument = new Document( is, htmloptions );
Iterator<Page> pages = pdfDocument.getPages().iterator();
while( pages.hasNext() ){
Page pageCollection = pages.next();
HeaderFooter header = new HeaderFooter();
Paragraphs headParagraph = new Paragraphs();
HtmlFragment headfragment = new HtmlFragment( pdfHeaderContent );
headfragment.setVerticalAlignment( VerticalAlignment.Top );
MarginInfo marginInfo = new MarginInfo();
marginInfo.setLeft( 10d );
marginInfo.setRight( 10d );
marginInfo.setBottom( 10d );
marginInfo.setTop( 10d );
header.setMargin( marginInfo );
headParagraph.add( headfragment );
header.setParagraphs( headParagraph );
pageCollection.setHeader( header );
}
请告诉我如何设置收割台的高度?
暂无答案!
目前还没有任何答案,快来回答吧!