java - Issues with embedding PDF in pptx using docx4j -
i have attach pdf file in pptx slide during runtime.
tried following:
attached pdf file in pptx slide (insert -> object -> adobe acrobat document). accessed oleobject using following code :
oleobjectbinarypart oleobjectbinarypart = new oleobjectbinarypart(new partname("/ppt/embeddings/oleobject1.bin"));
updating oleobjectbinarypart using following code:
oleobjectbinarypart.setbinarydata(reportblob.getbinarystream());
updating pptx new oleobject:
pptmlpackage.getparts().getparts().put(new partname("/ppt/embeddings/oleobject1.bin"), oleobjectbinarypart); pptmlpackage.save(new file("c:/test_report/pptx_out.pptx"));
after executing code pptx_out.pptx file got generated without errors. while trying open embedded pdf in powerpoint 2010 i'm getting following error:
the server application, source file, or item can't found, or returned unknown error. may need reinstall sever application.
is problem oleobject when updating?
you can't attach pdf binary blob; has in correct ole format.
see further this discussion.
Comments
Post a Comment