Loading an Existing PDF into Aspose.pdf Object

Hi,

I am trying to add a watermark to an existing PDF document with Aspose.pdf. Is this possible? I am trying to do this because when I add a watermark through PDF.KIT the size of the PDF generated doubles.

How can I add Watermarks to an existing pdf documents without doubling the size of the generated pdf document?

Hi,

Thank you for considering Aspose.

Editting existed pdf is not supported in Aspose.Pdf. I will tell the developers of Aspose.Pdf.Kit to check the file size problem. Which kinds of watermark are you adding? Can you please provide an example?

Thanks for your reply.

As per your request I have included the code that adds watermark to the PDF documents using Aspose.PDF.Kit. Basically, I am taking 46 PDF documents and adding a one text watermark. The original files do not have any water marks and the combined size of the original documents is 26MB. Once I add the watermark to each file through code shown below the resulting combined size of the PDF documents becomes 46MB.

'compile watermark data

For Each strPdfIN As String In IO.Directory.GetFiles(mstrOrigSource)

Application.DoEvents()

Dim strOutFile As String = mstrMarkSource & "\\" & New IO.FileInfo(strPdfIN).Name

Me.lblInfo.Text = "Adding Watermark to: " & New IO.FileInfo(strPdfIN).Name

Dim fileInfo As Aspose.Pdf.Kit.PdfFileInfo = New PdfFileInfo(strPdfIN)

Dim logoStamp1 As Stamp = New Aspose.Pdf.Kit.Stamp

logoStamp1.BindLogo(New FormattedText("My Text Watermark", System.Drawing.Color.FromArgb(180, 0, 0), FontStyle.TimesItalic, EncodingType.Winansi, False, 20))

logoStamp1.SetOrigin(100, 200)

logoStamp1.Opacity = 1.0F

Dim stamper As PdfFileStamp = New PdfFileStamp(strPdfIN, strOutFile)

stamper.AddStamp(logoStamp1)

stamper.Close()

Me.prgBar.PerformStep()

Next

The size issue has been fixed in latest version v2.3.1.0. Please spend some time to experience the newest one.

I just dowloaded and installed version 2.3.1 of the PDF.Kit. It did not fix size issue with the watermarks. I ran the same coded posted earlier. Is there something else I need to do? Thank You for your help.

I just downloaded and installed PDF.Kit 2.3.1. It did not fix size issue with the watermarks. I ran the same code posted earlier and the size of the documents did not change at all. Is there something else I need to do for this to work. Thank you for your help.

Please send both the pre-watermarked and watermarked pdf files to us. I will try to reproduce the size issue on testbed.

If these two files are over about 8MB, please mail to icekezuo@gmail.com.