Word SaveAsPDF Images missing

Posted by: m.mitchell on 13 July 2021, 2:01 am EST

  • Posted 13 July 2021, 2:01 am EST

    Hello,

    when i have da wordDocument (2007) with an image and i use the follwing Code:
    GcWordDocument.SetLicenseKey(licenseKeyWord);
    try
    {
    var wordDoc = new GcWordDocument();
    wordDoc.Load(WordDoc);
    using (var layout = new GcWordLayout(wordDoc))
    {
    PdfOutputSettings pdfo = new PdfOutputSettings();
    pdfo.CompressionLevel = CompressionLevel.Fastest;
    // save the whole document as PDF
    layout.SaveAsPdf(PDFDoc, null, pdfo);
    }
    return PDFDoc;
    }
    catch (Exception ex)
    {
    MessageBox.Show("Error:" + ex.InnerException);
    return "";
    throw;
    }
    everthing is fine in VS2017.
    Within my Application the Image (JPEG) ist missing and instead there is a Red Cross.
    What is missing?
    I am using the latest Version of Document for Words and Document for PDF (Vers. 4)

    Mike MItchell
  • Replied 13 July 2021, 4:40 pm EST

    Hello Mike,

    Sorry, we do not face the issue at our end. Can you please share the word file that is having the issue at your end so that we can investigate it further?

    Regards,
    Prabhat Sharma.
  • Replied 13 July 2021, 5:34 pm EST

    Documents.zip
    Included are 3 Files:
    1 Worddocument
    2 PDFFile out of Visual Studio 2017 (incl. the Image)
    3 PDFFile out of My Windows Forms Application (RedCross istead of Image)
  • Marked as Answer

    Replied 13 July 2021, 11:23 pm EST

    I solved the Problem.

    In my Windows.Forms.App I had to change the config File and add the following Text:
    <dependentAssembly>
    <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="8fb06cb64d019a17" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.13.0.0" newVersion="2.13.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.8.10.0" newVersion="1.8.10.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
    </dependentAssembly>

    Thanks for Your Help.
    Regards
    Mike Mitchell
  • Replied 14 July 2021, 8:26 pm EST

    Hello Mike,

    It is good to hear that the issue has been resolved at your end.
    If you need any other help, please feel free to ask.

    Regards,
    Prabhat Sharma.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels