IPersistFile Save() returns 0x80004001 E_NOTIMPL error when saving PDF documents

0

I'm using Delphi 2007. I'm getting 'Not implemented' exception when trying to call IPersistFile.Save() after loading document into Ole container. Problem exists for Acrobat Reader 10 and higher. The same code works for Acrobat Reader 9.

I was trying to find some solution on Adobe forum but without success. Maybe someone has the same problem before.

I'm using code like this:

procedure LoadAndSave();
var PF: IPersistFile;
    saveResult : integer;
    OleContainerDocument: TOleContainer;
    CreateInfo: TCreateInfo;
begin
  CreateInfo := ...
  OleContainerDocument.CreateObjectFromInfo(CreateInfo);

  OleContainerDocument.OleObjectInterface.QueryInterface(IPersistFile, PF);

  if PF <> nil then begin
    saveResult := PF.Save(StringToOleStr(FullFilePath), false);
    //In this place saveResult contains E_NOTIMPL error
  end
end;
delphi
pdf
adobe
ole
ipersistfile
asked on Stack Overflow May 16, 2017 by Emil • edited May 18, 2017 by Emil

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0