sliu

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • in reply to: How to determine cell width based on cell contents? #3848

    sliu
    Participant

    Ok, got it. OpenXml has the calculation.

    Thanks!

    in reply to: How to determine cell width based on cell contents? #3846

    sliu
    Participant

    In these two posts, they already knew the width of the columns. My question is how to determine the width of columns. For example, I have a string “Try this link as a starter”. What is the column width that can show all the words in the cell.

    Thanks for replying

    in reply to: How to determine cell width based on cell contents? #3841

    sliu
    Participant

    I meant how to calculate the width of a column so that when creating Spreadsheet via OpenXml the column width could be set reasonably.

    Thanks!

    in reply to: Update TOC using macro #3805

    sliu
    Participant

    I tried AutoOpen in .dotm. It doesn’t work. I’m using Office 2016. I think Microsoft has removed this feature. I just save the macro in Normal.dotm. This still works.

    Thanks for your help!

    in reply to: Update TOC using macro #3796

    sliu
    Participant

    I tried macro enabled Word document. I created AutoOpen and AutoExec macros in my docm. However the macros are not called when Word document opens. I don’t know how to invoke the macros automatically. So I will keep the macro in normal.dotm.

    Thanks

    in reply to: Open XML Package Editor for VS doesn't open .pptx as zip file #3779

    sliu
    Participant

    Thanks for the tips. I’ll try it.

    Thanks

    in reply to: PresentationBuilder cannot copy video slides correctly #3496

    sliu
    Participant

    This issue has been resolved. How do I help?

    in reply to: How to embed pdf file into PowerPoint slide #3428

    sliu
    Participant

    Hi Eric,

    I realized that in order to embed a document into pptx file the document has to be wrapped as ole object. Does OpenXml SDK provide API to convert PDF to OLE object? If not, do you have some knowledge on doing so in C#?

    Thanks in advance!!!

    in reply to: How to embed pdf file into PowerPoint slide #3420

    sliu
    Participant

    PowerPoint adds header and footer into the original PDF file to create its oleobject.bin file in pptx. Does OpenXml SDK have api to handle all of this to load original pdf file?

    Thanks in advance!!!

    in reply to: How to embed pdf file into PowerPoint slide #3419

    sliu
    Participant

    Hi Eric,

    I realized my code for reading pdf content is correct. The problem is PowerPoint adds some header content before pdf content during embedding the ole object. I compared embedded pdf (oleObject1.bin) and my original pdf file. I see oleObject1.bin replaces the starting string -%PDF-1.5 – with some other header information then following with the rest of the original pdf content.

    in reply to: How to embed pdf file into PowerPoint slide #3418

    sliu
    Participant

    Hi Eric,

    Do you know how Productivity Tool reads embedded objects in pptx? It loads all the objects, like image, video, audio, pdf, etc., into different string variables. If I use the string variable content created by Productivity Tool for embedded pdf, my code works. Do you know if Productivity Tool is open source on GitHub?

    Thanks in advance!!!

    in reply to: How to create HyperlinkOnClick using Linq to xml? #3312

    sliu
    Participant

    I figured out. Thanks!

    in reply to: Why new slides are not added to presentaion.xml sldIdList? #3301

    sliu
    Participant

    Ok, I didn’t know I cannot use both models on one open document. I can handle it to just use one model. I prefer Linq to Xml model, it is much easier to deal with modifying the content of the presentation.

    Thanks for the explanation!!!

    in reply to: Why new slides are not added to presentaion.xml sldIdList? #3276

    sliu
    Participant

    Hi Eric,

    I found what causes the problem, but I don’t know why.

    int Cx = doc.PresentationPart.Presentation.SlideSize.Cx;
    int Cy = doc.PresentationPart.Presentation.SlideSize.Cy;

    XDocument pDoc = doc.PresentationPart.GetXDocument();
    pDoc.Root.Descendants(P.sldId).First().Attribute(NoNamespace.id).Value = “260”;

    doc.PresentationPart.PutXDocument();

    If you run this code, presentation.xml is not modified and the first slide id is not changed from 256 to 260. If you comment out the first 2 lines, the change is saved. I don’t know why getting slide size prevents updating presentation.xml.

    in reply to: Why OpenXml SDK 2.5doesn't support mp4 format? #2580

    sliu
    Participant

    Sorry, I’m not git savvy. I’ll see what I can do.

Viewing 15 posts - 1 through 15 (of 21 total)