converting PDF files saved in a Stream Array to Tiff files
Aspose.PDF.KIT => Verify Digital Signature
I want to verify a singed pdf file.
1) this is how i sing the pdf file
Public Shared Sub SignPDFWithVisibleSignatureUsingAspose()
Dim oCertificate As Certificate = New Certificate("testvcg.pfx", "test")
Dim oPdfFileSignature As PdfFileSignature = New PdfFileSignature(oCertificate)
oPdfFileSignature.BindPdf("test2.pdf")
Dim oRec As System.Drawing.Rectangle = New System.Drawing.Rectangle(100, 100, 100, 100)
oPdfFileSignature.Sign(1, "Approved", "Ludwig Ghislain", "Gent Belgium", True, oRec)
oPdfFileSignature.Save("singed_valid.pdf")
Console.WriteLine("has signature?" & oPdfFileSignature.IsContainSignature)
Console.ReadLine()
End Sub
2) this is how I read the singed file
Public Shared Sub ValidateSingedPDFUsingAspose()
Dim oCertificate As Certificate = New Certificate("testvcg.pfx", "test")
Dim oPdfFileSignature As PdfFileSignature = New PdfFileSignature(oCertificate)
oPdfFileSignature.BindPdf("singed_valid.pdf")
Dim singatureAppearance As String = oPdfFileSignature.SignatureAppearance()
Console.WriteLine("Contains singature?: " & oPdfFileSignature.IsContainSignature())
Console.WriteLine("SignModel" & oPdfFileSignature.SignModel)
Dim oList As ArrayList = oPdfFileSignature.GetSignNames()
For I As Integer = 0 To oList.Count - 1
Console.WriteLine("signature name:" & oList(I))
Console.WriteLine("coverswholedocument:" & oPdfFileSignature.IsCoversWholeDocument(oList(I)))
Console.WriteLine("revision:" & oPdfFileSignature.GetRevision(oList(I)))
Console.WriteLine("verifysigned:" & oPdfFileSignature.VerifySigned(oList(I)))
Console.WriteLine("reason:" & oPdfFileSignature.GetReason(oList(I)))
Console.WriteLine("location:" & oPdfFileSignature.GetLocation(oList(I)))
Console.WriteLine("datatime:" & oPdfFileSignature.GetDateTime(oList(I)))
Next
Console.WriteLine(oPdfFileSignature.SignModel.ToString)
Console.ReadLine()
End Sub
The Result:
has signature?False
Contains singature?: True
SignModelAdobe.PPKLite
signature name:Signature1
coverswholedocument:True
revision:1
verifysigned:False
reason:Approved
location:Gent Belgium
datatime:29/10/2008 11:49:09
Adobe.PPKLite
The problem:
The oPdfFileSignature.VerifySinged expects an parameter "signName" and returns a string.
The name of the singature is: "Singature1" as you can see above.
Is it possible to change that name? so the VerifySinged method can be true and I can assume the document is singed with the correct certificate?
thx in advance
Ludwig
Repeat more than one row in every page
I am trying to generate a report that has more than 1 page, and on each page I want the first 2 rows to be repeated as the header of the table. I am using the following code snippet.
Dim tab1 As Aspose.Pdf.Generator.Table = New Aspose.Pdf.Generator.Table()
tab1.RepeatingRows = 2
The application is generated all reports, but I am only able to view the reports with one page. The reports with more than 1 page is corrupted and it says that the Adobe cannot support that version.
Could you please advice me on this issue.
Thanks!
Aspose.PDF.Net not working on Windows Server 2012
Open Password Protected File - Aspose.pdf for java
Table inside floating Box - IsBroken not working (which exceeds page height)
Font Not Found
TextFragment Position
HTML to PDF Conversion Error
When converting the attached Html file to pdf, I am getting the following error:
class com.aspose.pdf.internal.p344.z10: Value cannot be null.
Parameter name: rawHtml
com.aspose.pdf.internal.p225.z2.m1(Unknown Source)
com.aspose.pdf.internal.p211.z4.m2(Unknown Source)
com.aspose.pdf.internal.p211.z5.m1(Unknown Source)
com.aspose.pdf.internal.p211.z4.m3(Unknown Source)
com.aspose.pdf.internal.p211.z4.m3(Unknown Source)
com.aspose.pdf.internal.p211.z4.m1(Unknown Source)
com.aspose.pdf.internal.p211.z4.m1(Unknown Source)
com.aspose.pdf.internal.p214.z1.m1(Unknown Source)
com.aspose.pdf.z30.m1(Unknown Source)
com.aspose.pdf.ADocument.m1(Unknown Source)
com.aspose.pdf.ADocument.<init>(Unknown Source)
com.aspose.pdf.Document.<init>(Unknown Source)
Please let me know how to resolve this issue.
Thanks.
Centering Images
GDI+ error on Windows Server 2003
Hello,
I've got this error when running the attached project on a Windows Server 2003
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Image.SaveAdd(EncoderParameters encoderParams)
at ‼.§‼.??()
at Aspose.Pdf.Devices.TiffDevice.Process(Document document, Int32 fromPage, Int32 toPage, Stream output)
at Aspose.Pdf.Devices.DocumentDevice.Process(Document document, Int32 fromPage, Int32 toPage, String outputFileName)
at TEST_ASPOSE.PDF.Program.SplitToTifPdf(Stream stream, Int16 pageOffset) in
c:\dev\chomele\TEST\TEST_ASPOSE.PDF\TEST_ASPOSE.PDF\Program.cs:line 50
I'm using Aspose.PDF 9.5.0 and framework dotNet 4. For your information, running this program on Windows Server 2012, this error doesn't show up.
Any help appreciated,
Elisa.
TextBoxField Background Color Alpha
Merge ODF
Font name not recognized
Textbox with Justify not working when text contains a parameter
converting PDF files saved in a Stream Array to Tiff files
Aspose.PDF.KIT => Verify Digital Signature
I want to verify a singed pdf file.
1) this is how i sing the pdf file
Public Shared Sub SignPDFWithVisibleSignatureUsingAspose()
Dim oCertificate As Certificate = New Certificate("testvcg.pfx", "test")
Dim oPdfFileSignature As PdfFileSignature = New PdfFileSignature(oCertificate)
oPdfFileSignature.BindPdf("test2.pdf")
Dim oRec As System.Drawing.Rectangle = New System.Drawing.Rectangle(100, 100, 100, 100)
oPdfFileSignature.Sign(1, "Approved", "Ludwig Ghislain", "Gent Belgium", True, oRec)
oPdfFileSignature.Save("singed_valid.pdf")
Console.WriteLine("has signature?" & oPdfFileSignature.IsContainSignature)
Console.ReadLine()
End Sub
2) this is how I read the singed file
Public Shared Sub ValidateSingedPDFUsingAspose()
Dim oCertificate As Certificate = New Certificate("testvcg.pfx", "test")
Dim oPdfFileSignature As PdfFileSignature = New PdfFileSignature(oCertificate)
oPdfFileSignature.BindPdf("singed_valid.pdf")
Dim singatureAppearance As String = oPdfFileSignature.SignatureAppearance()
Console.WriteLine("Contains singature?: " & oPdfFileSignature.IsContainSignature())
Console.WriteLine("SignModel" & oPdfFileSignature.SignModel)
Dim oList As ArrayList = oPdfFileSignature.GetSignNames()
For I As Integer = 0 To oList.Count - 1
Console.WriteLine("signature name:" & oList(I))
Console.WriteLine("coverswholedocument:" & oPdfFileSignature.IsCoversWholeDocument(oList(I)))
Console.WriteLine("revision:" & oPdfFileSignature.GetRevision(oList(I)))
Console.WriteLine("verifysigned:" & oPdfFileSignature.VerifySigned(oList(I)))
Console.WriteLine("reason:" & oPdfFileSignature.GetReason(oList(I)))
Console.WriteLine("location:" & oPdfFileSignature.GetLocation(oList(I)))
Console.WriteLine("datatime:" & oPdfFileSignature.GetDateTime(oList(I)))
Next
Console.WriteLine(oPdfFileSignature.SignModel.ToString)
Console.ReadLine()
End Sub
The Result:
has signature?False
Contains singature?: True
SignModelAdobe.PPKLite
signature name:Signature1
coverswholedocument:True
revision:1
verifysigned:False
reason:Approved
location:Gent Belgium
datatime:29/10/2008 11:49:09
Adobe.PPKLite
The problem:
The oPdfFileSignature.VerifySinged expects an parameter "signName" and returns a string.
The name of the singature is: "Singature1" as you can see above.
Is it possible to change that name? so the VerifySinged method can be true and I can assume the document is singed with the correct certificate?
thx in advance
Ludwig
Repeat more than one row in every page
I am trying to generate a report that has more than 1 page, and on each page I want the first 2 rows to be repeated as the header of the table. I am using the following code snippet.
Dim tab1 As Aspose.Pdf.Generator.Table = New Aspose.Pdf.Generator.Table()
tab1.RepeatingRows = 2
The application is generated all reports, but I am only able to view the reports with one page. The reports with more than 1 page is corrupted and it says that the Adobe cannot support that version.
Could you please advice me on this issue.
Thanks!
Not able to write .png file in PDF
java.lang.OutOfMemoryError: Java heap space Reading simple PDF
I have increased the JVM memory but I still get the error.
here is the code
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("input.pdf");
// Loop through all the pages of PDF file
for (int pageCount = 1; pageCount
{
// Create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream("Converted_Image" + pageCount + ".jpg");
// Create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);
// Create JpegDevice object where second argument indicates the quality of resultant image
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
// Convert a particular page and save the image to stream
jpegDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);
// Close the stream
imageStream.close();
}
and this is the error.
Exception in thread "AgentThread: JavaAgent" java.lang.OutOfMemoryError: Java heap space
at java.lang.StringCoding.decode(StringCoding.java:505)
at java.lang.String.
at java.util.jar.Manifest.parseName(Manifest.java:262)
at java.util.jar.Manifest.read(Manifest.java:216)
at java.util.jar.Manifest.
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:170)
at java.util.jar.JarFile.getManifest(JarFile.java:153)
at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:944)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:465)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
at java.net.URLClassLoader.access$300(URLClassLoader.java:79)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1038)
at java.security.AccessController.doPrivileged(AccessController.java:365)
at java.net.URLClassLoader.findClass(URLClassLoader.java:429)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:281)
at java.lang.ClassLoader.loadClass(ClassLoader.java:677)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
at com.aspose.pdf.internal.p357.z2.
at com.aspose.pdf.internal.p597.z2.m1(Unknown Source)
at com.aspose.pdf.internal.p634.z8.
at com.aspose.pdf.internal.p631.z12.m1(Unknown Source)
at com.aspose.pdf.internal.p561.z6.
at com.aspose.pdf.internal.p598.z2.m1(Unknown Source)
at com.aspose.pdf.internal.p564.z7.m1(Unknown Source)
at com.aspose.pdf.devices.z1.m1(Unknown Source)
at com.aspose.pdf.devices.z1.m1(Unknown Source)
at com.aspose.pdf.devices.ImageDevice.m1(Unknown Source)
at com.aspose.pdf.devices.JpegDevice.processInternal(Unknown Source)
at com.aspose.pdf.devices.JpegDevice.process(Unknown Source)
at JavaAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
I am not sure if this is important but the PC running this code is not connected to the internet.
Also it is running an a IBM Notes client.
THanks