Hello i just tried to read an attachment form the PDF File.
The following command returns correct 1 (there is one XML File attached)
Code
count := pdfView.command(COMPDF_Attachment_List);
if count > 0 then Data := ReadAttachment(pdfView, 0);
Code
function ReadAttachment(pdfview : TWPViewPDF; Index : integer) : string
var
sSize : integer;
propIdx : string;
begin
propIdx := temp.CommandGetStr( COMPDF_Attachment_GetProp, '', Index);
sSize := temp.Command( COMPDF_Attachment_GetData );
if sSize >= 0 then begin
setlength(Result, sSize);
temp.CommandEx( COMPDF_MakeGetMEMORY, Cardinal( @Result[1] ) );
end;
end;
Display More
But this function doesn't work, the first COMPDF_Attachment_GetProp returns an empty string - i have copied the code from unit WPViewpdfAttachmentlist;
can you point me to the wrong code?