Exemple #1
0
        public virtual void LockedLayer()
        {
            String      outPdf = destinationFolder + "lockedLayer.pdf";
            String      cmpPdf = sourceFolder + "cmp_lockedLayer.pdf";
            PdfDocument pdfDoc = new PdfDocument(new PdfWriter(outPdf));
            PdfFont     font   = PdfFontFactory.CreateFont();
            PdfLayer    layer1 = new PdfLayer("Layer 1", pdfDoc);
            PdfLayer    layer2 = new PdfLayer("Layer 2", pdfDoc);

            layer2.SetLocked(true);
            PdfCanvas canvas = new PdfCanvas(pdfDoc.AddNewPage());

            canvas.SetFontAndSize(font, 12);
            PdfLayerTestUtils.AddTextInsideLayer(layer1, canvas, "Layer 1 text", 100, 700);
            PdfLayerTestUtils.AddTextInsideLayer(layer2, canvas, "Layer 2 text", 100, 650);
            pdfDoc.Close();
            PdfLayerTestUtils.CompareLayers(outPdf, cmpPdf);
        }