Hi,
what is wrong?
in this code?
Thank Miro
int docId;
PDFX2.OpenDocument(@"C:\AAA\aaa.pdf", "", out docId, 0);
Object dOut=null;
object[] dIn = new object[3];
dIn[0] = @"C:\AAA\bbb.pdf";
dIn[1] = "Attachment";
dIn[2] = "Description" ;
try
{
PDFX2.DoVerb("Document[0]", "AddAttachment", dIn, out dOut, 0); <--------- "Invalid argument" error
}
catch (Exception ex)
{
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex));
}
PDFX2.CloseAllDocuments();
Invalid argument error for AddAttachment
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Invalid argument error for AddAttachment
Hello miromr,
I believe that the docID you are trying to pass to the DoVerb method is your problem. Please try replacing that with the docID variable from earlier in your code
Best,
Stefan
I believe that the docID you are trying to pass to the DoVerb method is your problem. Please try replacing that with the docID variable from earlier in your code

Best,
Stefan
-
- User
- Posts: 59
- Joined: Sat May 09, 2009 3:05 pm
Re: Invalid argument error for AddAttachment
Hi Stefan
problem still persists:
private void button1_Click(object sender, EventArgs e)
{
PDFX2.OpenDocument(@"C:\AAA\aaa.pdf", "", out hndDoc, 0);
Object dataOut = null;
Object[] dataIn = new object[3];
dataIn[0] = @"C:\AAA\bbb.pdf";
dataIn[1] = "Attachment";
dataIn[2] = "Description";
try
{
PDFX2.DoVerb("Document[0]", "AddAttachment", dataIn, out dataOut, (int)PXCVA_Flags.PXCVA_NoUI);
}
catch (Exception ex)
{
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex));
}
PDFX2.CloseAllDocuments();
}
Thank Miro
problem still persists:
private void button1_Click(object sender, EventArgs e)
{
PDFX2.OpenDocument(@"C:\AAA\aaa.pdf", "", out hndDoc, 0);
Object dataOut = null;
Object[] dataIn = new object[3];
dataIn[0] = @"C:\AAA\bbb.pdf";
dataIn[1] = "Attachment";
dataIn[2] = "Description";
try
{
PDFX2.DoVerb("Document[0]", "AddAttachment", dataIn, out dataOut, (int)PXCVA_Flags.PXCVA_NoUI);
}
catch (Exception ex)
{
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex));
}
PDFX2.CloseAllDocuments();
}
Thank Miro
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Invalid argument error for AddAttachment
Hello Miro,
Why don't you try the
DoDocumentVerb(docId, NULL, "AddAttachment", DataIn ...
method?
Best,
Stefan
Why don't you try the
DoDocumentVerb(docId, NULL, "AddAttachment", DataIn ...
method?
Best,
Stefan
-
- User
- Posts: 59
- Joined: Sat May 09, 2009 3:05 pm
Re: Invalid argument error for AddAttachment
Yes thank you very much Stefan! 

-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Invalid argument error for AddAttachment
Pleasure Miro! 
Cheers,
Stefan

Cheers,
Stefan