Unable to print Stamp PDF file

Hi,

I am using Aspose.pdf.kit to stamp the PDF file,When i print the original file it's getting print properly but when i try to print Stamp file it's unable to get print.I check with other computer also and is same result.

I have attached both original and Stamped file.

Regards,

Ritesh N. Jain

Hi,

Thank you for considering Aspose.

I am unable to reproduce this error. I have tried to print both the files with and without stamped and both are printing fine. I have checked with Adobe Printer. I will check it on the other physical printer and will let you know the exact results as well.

Thanks.

Hi,
Thanks for reply.Yes it is printing fine of virtual printer but if you try to print on physical printer its unable to print.I even tried with latest ver of pdfkit i.e 2.6.0 for .NET but having same problem.
But once if i print of virtual printer and save this file and than again if i print this newly saved file (with stmap) it’s printing fine.

I am getting this problem with not all but few PDF files.

Looking forward for reply.

Regards,
Ritesh N. Jain

Hi,

Ok, I will check this with the files you have sent and will get back to you soon. Are these the ones which are not working? or there are some other, please let me know.

Thanks.

Hi,

I have checked the files you have sent and found that there is some problem in printing these But on my side I won't be able to find any problems. I tried with the code shown below and I am attaching the Pdf for your reference generated. Please share your code so that we could be able to investigate this issue.

Thanks.

Hi,

I have tested this issue too and I can’t reproduce this error. I can print your document to real printer.

Hi,

Thanks for reply.I am getting this problem with other files also (Not all).I tried to print these files from my machine to 2-3 different printer as well as i tried same with 2-3 other machine also but same result.

Here is my sample code

Dim license As Aspose.Pdf.Kit.License = New Aspose.Pdf.Kit.License()
license.SetLicense("Aspose.Pdf.kit.lic")


Dim path As String = MapPath(".")
''path = path.Substring(0, path.LastIndexOf("\"))

Dim enCulture As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("")
Dim d As Single = Single.Parse("0.78431", enCulture)
Dim stamper As PdfFileStamp = New PdfFileStamp(path & Replace(strFilePath, "~", "").Replace("/", "\"), path & Replace(strFilePath, "~", "").Replace("/", "\") & ".pdf")
Dim aStamp As Stamp = New Stamp()

Dim fontsize As Single = Convert.ToSingle(ConfigurationSettings.AppSettings("WaterMarkTextFont"), enCulture)

Dim objFormatter As FormattedText
objFormatter = New FormattedText(ConfigurationSettings.AppSettings("WaterMarkText"), New FontColor(255, 0, 0), FontStyle.TimesBold, EncodingType.Winansi, False, fontsize)
objFormatter.AddNewLineText("Un-Controlled Copy")
objFormatter.AddNewLineText(IO.Path.GetFileName(path & Replace(strFilePath, "~", "").Replace("/", "\")))

aStamp.BindLogo(objFormatter)

aStamp.IsBackground = False

Dim rotation As Single = Convert.ToSingle(ConfigurationSettings.AppSettings("WaterMarkTextRotation"), enCulture)
aStamp.Rotation = rotation

Dim originX As Single = Convert.ToSingle(ConfigurationSettings.AppSettings("WaterMarkTextXPosition"), enCulture)
Dim originY As Single = Convert.ToSingle(ConfigurationSettings.AppSettings("WaterMarkTextYPosition"), enCulture)
aStamp.SetOrigin(originX, originY)

aStamp.Opacity = 0.5

stamper.AddStamp(aStamp)
stamper.Close()

strFilePath &= ".pdf"

Response.Redirect(strFilePath)

---------------------------------------------------------------------------------

My main printer is HP Color LaserJet 5550..If you want i can send u few more sample files which are not getting porinted after stamping.

Regards,

Ritesh

Hi Adeel,

I can not see any stamp in attached file...i hope i am not missing something.

Regards,

Ritesh

Hi,

Here it is another attachment for your reference. The code used is here:

string path1 = @“E:\AsposeTest\Test1. PM-0002-5022ELLI501.pdf.pdf”;
string path2 = @“E:\AsposeTest\Test1\Stamp.pdf”;
Stamp logoStamp = new Stamp();
logoStamp.BindLogo(new FormattedText(“Hello World!”, System.Drawing.Color.FromArgb(180, 0, 0), FontStyle.TimesItalic, EncodingType.Winansi, false, 50));
logoStamp.Rotation = 45;
logoStamp.Opacity = 1f;

PdfFileStamp stamper = new PdfFileStamp(path1, path2);
stamper.AddStamp(logoStamp);
stamper.Close();

Thanks.

Hi,

I am able to print the attached document but when i stamp original document ar my end i am getting same problem.I tried to stamped doc from other machine also but same resultAs far as code is concern both are same.Whenever i try to print stamp document the printer progress bar stop at 40% with me "This document could not be printed" message.

Regards,

Ritesh

Hi,

I wonder why I can’t reproduce this error. Even Tommy has checked and he is unable to find this problem as well. Please send us your whole project in runnable form, so we might try to get something from it. If it is greater then 5MB then you can send to me by following the steps mentioned here:

How to Share a Document in a Forum Post

Thanks.