pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bal (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (PDFBOX-4312) Signature is not getting inserted into 00000 area
Date Tue, 23 Oct 2018 07:32:00 GMT

     [ https://issues.apache.org/jira/browse/PDFBOX-4312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

bal updated PDFBOX-4312:
    Comment: was deleted

(was: I have generated byte  array by deserializing the xml to object. The size of byte array
for docsignature element i am getting is 2911 belowis the code for that.I am storing this
byte array to docSigDict dictionary and retriving this value to assign to byte array in sign
method. yet my signature in not inserting in the blankbox please guide me it's very important
to me to solve this issue .


public class XmlObjectConverter
 private XmlSerializer Serializer;
 private XmlSerializer Deserializer;
 string XmlString = "";

 public XmlSerializer getSerializer()
 return Serializer;

public void setSerializer(XmlSerializer serializer)
 this.Serializer = serializer;

public XmlSerializer getDeserializer()

return Deserializer;


public void setDeserializer(XmlSerializer deserializer)
 this.Deserializer = deserializer;

public String ObjectToXml<EsignResponse>(EsignResponse obj)
 XmlSerializer serializer = new XmlSerializer(typeof(EsignResponse));

using (System.IO.StringWriter textWriter = new System.IO.StringWriter())
 serializer.Serialize(textWriter, obj);
 return XmlString.ToString();


public object XmlToObject(object obj, string XmlString)
 XmlDocument xDoc = new XmlDocument();


XmlSerializer serializer = new XmlSerializer(typeof(EsignResponse), new XmlRootAttribute("EsignResp"));
 MemoryStream stream = new MemoryStream();
 System.IO.StringWriter sw = new System.IO.StringWriter();
 byte[] bytes = Encoding.UTF8.GetBytes(XmlString);
 //MemoryStream xmlStream = new MemoryStream(bytes);
 MemoryStream output = new MemoryStream(bytes);
 obj = serializer.Deserialize(output);

return obj;



> Signature is not getting inserted into 00000 area
> -------------------------------------------------
>                 Key: PDFBOX-4312
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4312
>             Project: PDFBox
>          Issue Type: Bug
>          Components: .NET, PDModel, Signing
>    Affects Versions: 1.8.9, 1.8.15
>            Reporter: bal
>            Priority: Major
>             Fix For: 1.8.17
>         Attachments: testingSignature-signed-SaveIncremental-1param-bad-cutoff.pdf, testingSignature-signed-SaveIncremental-2param-good.pdf
> Hi ,
> I want to sign pdf using signature in pkcs 7 format . I am converting pkcs 7 signature
to byte array using Convert.FromBase64String method in .net . I am passing this byte array
to sign method in signature interface which gets called after calling saveincremental. My
byte array is inserting proper but the name of which signature is not shown when i open pdf.
May be my byte conversion may not proper or something else i am doing wrong. please let me

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org

View raw message