Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6537181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:35:10+00:00 2026-05-25T10:35:10+00:00

I am trying to find a SDK that can generate PDF from OpenXml. I

  • 0

I am trying to find a SDK that can generate PDF from OpenXml. I have used the Open Xml Power Tools to convert the open XML and html and and using iTextSharp to parse the Html to PDF. But the result is a very terrible looking PDF.

I have not yet tried the iText’s RTF parser. If I go this direction, I will end up needing a RTF converter making the simple conversion a double step nightmare.

It almost looks like I might end up writing a custom converter based of power tools OpenXml to html converter. Any advise is appreciated. I really at this time can’t end up going for a professional converter as the licenses are too expensive (Aspose Word/TxText).


I thought I will put some more effort into my investigation. I went back to the conversion utility “http://msdn.microsoft.com/en-us/library/ff628051.aspx” and looked through its code. Given the biggest thing it missed was reading the underlying styles and generate a style attribute. The PDF looked much better with the limitation of not handling custom true type font. More investigation tomorrow. I am hoping has done something like this/faced weird issues and can shed some light.




    private static StringDictionary GetStyle(XElement el)
    {
        IEnumerable jcL = el.Elements(W.jc);
        IEnumerable spacingL = el.Elements(W.spacing);
        IEnumerable rPL = el.Elements(W.rPr);

        StringDictionary sd = new StringDictionary();

        if (HasAttribute(jcL, W.val)) sd.Add("text-align", GetAttribute(jcL, W.val));

        // run prop exists
        if (rPL.Count() > 0)
        {
            XElement r = rPL.First();
            IEnumerable ftL = el.Elements(W.rFonts);

            if (r.Element(W.b) != null) sd.Add("font-weight", "bolder");
            if (r.Element(W.i) != null) sd.Add("font-style", "italic");
            if (r.Element(W.u) != null) sd.Add("text-decoration", "underline");
            if (r.Element(W.color) != null && HasAttribute(r.Element(W.color), W.val)) sd.Add("color", "#" + GetAttribute(r.Element(W.color), W.val));
            if (r.Element(W.rFonts) != null )
            {
                // 
                if(HasAttribute(r.Element(W.rFonts), W.cs)) sd.Add("font-family", GetAttribute(r.Element(W.rFonts), W.cs));
                else if (HasAttribute(r.Element(W.rFonts), W.hAnsi)) sd.Add("font-family", GetAttribute(r.Element(W.rFonts), W.hAnsi));
            }
            if (r.Element(W.sz) != null && HasAttribute(r.Element(W.sz), W.val)) sd.Add("font-size", GetAttribute(r.Element(W.sz), W.val) + "pt");
        }

        return sd.Keys.Count > 0 ? sd : null;
    }


  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:35:11+00:00Added an answer on May 25, 2026 at 10:35 am

    I don’t know of any direct converter with source-code availabe, but yeah, my thought is that you may need to build a converter from scratch. Luckily (I guess), Word’s WordprocessingML is the simplest of the Open XML formats and you can look to other projects for inspiration, such as:

    1. TextGlow – Word to Silverlight converter
    2. Word to XAML Converter – Word to XAML converter (probably very
      similar to TextGlow above)
    3. OpenXML-DAISY – conversion to Daisy
    4. ODF Converter – convert from/to OpenOffice formats and OpenXML
    5. The XHTML solution by Eric White you already referenced.

    For commercial & server-side solutions, you can use either Word Automations Services (requires SharePoint) or Apose.NET Words.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to find an XML file I can use in lieu of a look-up
Im trying to find out a good JavaScript library that can create a nice
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
Trying to find the sqlserver adapter for rails on windows. I have tried getting
Trying to find an example that has css rollover using sprites & sliding door
Trying to find a way to send a POST HTTPS request from Python to
I am trying to find a NullPointerException that I get when in my app
I have an SDK that is written primarily in C#. We have some native
I am trying to find a way to have plugins in an application. My
I'm trying to find a method using the Amazon S3 SDK for .Net to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.