Skip to content

Add Objects (PDFs, Excel, Image, Word etc) and update the icon image and captions programmatically using OpenXML #1803

@AlgorithmicThoughts

Description

@AlgorithmicThoughts

I'm working on an ASP.NET project where I am developing an endpoint that uses OpenXML to generate an Excel file. Additionally, I create a PDF document using a third-party tool. I need to insert the PDF stream into an Excel sheet (similar to insert object option of the excel). I discovered via a StackOverflow post that this can be done using COM Interop which I want to avoid as this would mean storing the Excel DLLS on the server and starting a new instance of excel whenever I want to add the PDFs into the excel (please correct if my understanding is incorrect).

I would also like to update the icon and the caption of the attached PDF object (this is also a requirement I am currently looking into but was not able to get an answer to)

image

Is there a way to insert the PDF stream directly into the Excel sheet and update it's icon and caption without relying on COM? Are there existing options to achieve this?

Describe the solution you'd like

A method to embed PDF streams and update its icon image and captions into Excel sheets directly using OpenXML, eliminating the need for COM Interop or any third party.

Here's what I know so far but it does not work in my case

  1. Using COM Interop to embed the PDF, which isn't feasible in my case.
  2. Converting the PDF to an image and embedding it, which isn't ideal for maintaining document integrity.
  3. Including a hyperlink to the PDF location, which doesn't truly embed the document in the Excel file.

This feature would greatly enhance the flexibility and functionality of OpenXML, providing a more seamless experience for developers needing to embed various objects in Office documents.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions