|
@@ -72,9 +72,9 @@ public class Word2Pdf {
|
|
|
//lo.setEncoding(Encoding.getUTF8());
|
|
//lo.setEncoding(Encoding.getUTF8());
|
|
|
Document doc = new Document(inputStream);// 原始excel路径
|
|
Document doc = new Document(inputStream);// 原始excel路径
|
|
|
removeWatermark(doc);
|
|
removeWatermark(doc);
|
|
|
- insertWatermarkText(doc, watermark, 0, 0);
|
|
|
|
|
- insertWatermarkText(doc, watermark, 200, 0);
|
|
|
|
|
- insertWatermarkText(doc, watermark, 400, 0);
|
|
|
|
|
|
|
+ insertWatermarkText(doc, watermark, 100, 0);
|
|
|
|
|
+ insertWatermarkText(doc, watermark, 300, 0);
|
|
|
|
|
+ insertWatermarkText(doc, watermark, 550, 0);
|
|
|
|
|
|
|
|
/*PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(SaveFormat.PDF);
|
|
/*PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(SaveFormat.PDF);
|
|
|
pdfSaveOptions.setOnePagePerSheet(true);
|
|
pdfSaveOptions.setOnePagePerSheet(true);
|
|
@@ -139,9 +139,9 @@ public class Word2Pdf {
|
|
|
watermark.getTextPath().setText(watermarkText);
|
|
watermark.getTextPath().setText(watermarkText);
|
|
|
watermark.getTextPath().setFontFamily("宋体");
|
|
watermark.getTextPath().setFontFamily("宋体");
|
|
|
watermark.setWidth(500);
|
|
watermark.setWidth(500);
|
|
|
- watermark.setHeight(30);
|
|
|
|
|
|
|
+ watermark.setHeight(20);
|
|
|
// Text will be directed from the bottom-left to the top-right corner.
|
|
// Text will be directed from the bottom-left to the top-right corner.
|
|
|
- watermark.setRotation(-40);
|
|
|
|
|
|
|
+ watermark.setRotation(-35);
|
|
|
// Remove the following two lines if you need a solid black text.
|
|
// Remove the following two lines if you need a solid black text.
|
|
|
watermark.getFill().setColor(Color.lightGray); // Try LightGray to get more Word-style watermark
|
|
watermark.getFill().setColor(Color.lightGray); // Try LightGray to get more Word-style watermark
|
|
|
watermark.setStrokeColor(Color.lightGray); // Try LightGray to get more Word-style watermark
|
|
watermark.setStrokeColor(Color.lightGray); // Try LightGray to get more Word-style watermark
|