
It will show output like the following.įirst it will show like the following to enter a password and click OK. = PdfPermissionsFlags.Print | PdfPermissionsFlags.FillFields.The following code encrypts the PDF document.doc.SaveToFile(outputFile, FileFormat.PDF).PdfLayoutResult result = grid.Draw(page, new PointF(10, 30)).//Draw pdf grid into page at the specific location.textAndStyle.ImageSize = new SizeF(70,70).textAndStyle.Image = PdfImage.FromFile( "ccorner.jpg" ).PdfGridCellTextAndStyle textAndStyle = new PdfGridCellTextAndStyle().PdfGridCellTextAndStyleList lst = new PdfGridCellTextAndStyleList().private static void InsertImageIntoPDF().Insert the following code for inserting an image into the PDF.Select C# Language then select Console Application and name it “InsertImageToPDF”.NET.Ĭreate a Console Application for the demo. This guide introduces an easy way to insert an image via Spire.PDF for. In the second part you understand how to Encrypt a PDF document with a password. How to draw a nested grid in a PDF document and set a grid row & cell format. NET PDF component to quickly generate, open, modify and save PDF documents without using Office Automation and enables users to insert an image into a PDF and set its size depending on the page using C#. Sometimes, an image can describe some content more clearly, like using a chart to show how data changes in a period. Images are more attractive for reading documents. We will create a simple PDF grid and show how to insert an image into a specific PDF grid cell in C#.
