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 8177987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:39:33+00:00 2026-06-06T23:39:33+00:00

Context What we need is to capture some user input (formatted text) from a

  • 0

Context

What we need is to capture some user input (formatted text) from a WPF application and output a PDF with some stored images AND the user input on the last page.

What we’ve tried

We create the WPF app, add the iTextSharp library, recover the images from the DB and add it to the PDF. That’s working. Now, for the user input we added a RichTextBox control from the Extended WPF Toolkit. We added this control mainly because of its binding properties and formatters. Basically we can bind the rich content of the control to a property. That binding is working. We already have the RTF format, as (in example):

"{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\ltrch This is the }{\b\ltrch RichTextBox}\li0\ri0\sa0\sb0\fi0\ql\par}}}"

Problem

The thing is, the actual output of the PDF is precisely that previously shown RTF, but the expected output (for the example) must be:

"This is the **RichTextBox**\r\n"

This is happening obviously because we are inserting the binded RTF from the control as it comes to the PDF, the thing is: How can we add that content and specify its RTF?

PS. If you have other working idea or solution (without using a richtextbox, or something like that) it’s welcome. Thanks in advance.

  • 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-06-06T23:39:34+00:00Added an answer on June 6, 2026 at 11:39 pm

    Unfortunately, iTextSharp does not directly support RTF format anymore. I would suggest to convert the RTF fragment to XHTML first and then import the resulting XHTML into the final document (it seems that the official HTML support is gone away, so XHTML is the only alternative in this case).

    In short, I would suggest to:

    1. convert the RTF fragment into XHTML;
    2. place the XHTML stream into a new iTextSharp document (or directly into the final document, if you wish);
    3. add the content of the aforementioned document into the target document you are going to export as PDF.

    UPDATE

    There is no built-in mechanism to convert from RTF to XHTML but many open source project exist; I would start coupling this RTF to HTML converter with the HTML Agility Pack (which will in turn convert your HTML to XHTML).

    Frankly, however, the whole flow is a bit complex to follow and I would perhaps opt for a simpler solution, maybe by using an HTML editor (alternative) directly in your project or by reverting to the FlowDocument as others have suggested.

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

Sidebar

Related Questions

My application allows the user to capture a numeric value. In the context I
Context: I need to develop a monitoring server that monitors some of our applications
I need some help removing spaces after hiding certain HTML elements. In context, I
Is there some method to issue a screen capture(browser window content only) from the
I need to make an AJAX request to some script from the onSave event
I need to capture the entire screen with a transparent WPF window as the
i'm building an application in which i need to take a photo from a
I'm using GLFW for creating OpenGL context and capturing user's input and I wanted
I need the context to ApplicationContext.xml ,which I provided in web.xml as <listener> <listener-class>
I have a problem to test my non activity-class which need the context of

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.