Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java canvas.beginMarkedContentSequence是什么_Java - Fatal编程技术网

Java canvas.beginMarkedContentSequence是什么

Java canvas.beginMarkedContentSequence是什么,java,Java,在我们的项目中,我们停止使用iText(我认为是成本问题),所以我们找到了openPdf 我替换了所有导入,它正在编译,除了这段代码 这不是compling canvas.beginMarkedContentSequence(PdfName.ARTIFACT); // not compling PdfName.ARTIFACT does not exists 有人能给我解释一下这段代码在做什么,我应该投入什么价值吗 PdfName.??? openPdf中的PdfName有各种各

在我们的项目中,我们停止使用iText(我认为是成本问题),所以我们找到了openPdf

我替换了所有导入,它正在编译,除了这段代码 这不是compling

    canvas.beginMarkedContentSequence(PdfName.ARTIFACT); // not compling PdfName.ARTIFACT does not exists
有人能给我解释一下这段代码在做什么,我应该投入什么价值吗

 PdfName.???

openPdf中的PdfName有各种各样的价值,但我不知道它们是什么意思

这是完整的代码

public void onEndPage(PdfWriter writer, Document document) {
        PdfPTable table = new PdfPTable(3);
        try {
            table.setWidths(new int[] { 450, 50, 2 });
            table.setTotalWidth(520);
            table.getDefaultCell().setFixedHeight(24);
            table.getDefaultCell().setBorder(Rectangle.TOP);
            table.getDefaultCell().setBorderColor(Color.LIGHT_GRAY);
            table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            table.addCell(new Phrase(misparMislaka + " : הקלסמ דוק / " + misparMezaheLakoah + " : חטובמ רפסמ / " + date + " : הרבעה ךיראת ", font));
            table.addCell(new Phrase(String.format("Page %d of", writer.getPageNumber()), font));
            PdfPCell totalPageCount = new PdfPCell(total);
            totalPageCount.setBorder(Rectangle.TOP);
            totalPageCount.setBorderColor(Color.LIGHT_GRAY);
            table.addCell(totalPageCount);
            PdfContentByte canvas = writer.getDirectContent();
            canvas.beginMarkedContentSequence(PdfName.ARTIFACT); // not compling PdfName.ARTIFACT does not exists
            table.writeSelectedRows(0, -1, 36, 30, canvas);
            canvas.endMarkedContentSequence();
        } catch (DocumentException de) {
            throw new ExceptionConverter(de);
        }
    }

你找到解决办法了吗?我刚接触到它。不,我们发现我们可以使用html instaedi。我让它工作了。我刚取下画布。开始和结束