I have a set of RTF's stored in strings in C# is their a way to merge these into one document for printing as the user wants to print them as one document with the print settings appearing once. I can use office interop if necessary, obviously avoiding this is better.
Edit: A page break would be necessary between each document I think I can just insert \page for this though
Google Chromebook and Other Android Mobile DevicesTry editing rtf files using Microsoft Office Mobile or Microsoft Word app for Android. Both are available on Google Play. Editing rtf files is also possible using Google Docs.
Rich Text Format (RTF) is a file format that lets you exchange text files between different word processors in different operating systems (OSes). For example, you can create a file in Microsoft Word and then open it in another word processor, such as Apple Pages or Google Docs.
You would have to remove the trailing } from the first document.
You would have to remove the {\rtf1... and {fonttbl.. and {colortbl... sections from the second document. Might need to look at any header, margins etc. that you might have.
Separate them by a \page as you say.
This assumes the font and color tables are the same.
Probably better to get the print settings from the user then silently print each document separately, if that's an option.
Document 1:
{\rtf1\ansi\ansicpg1252\deff0\deflang5129
{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}}
{\colortbl;\red0\green0\blue0;}
\margl1134\margr1134\margt1134\margb1134\sectd
\pard
Document One Content
\line
}
Document 2:
{\rtf1\ansi\ansicpg1252\deff0\deflang5129
{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}}
{\colortbl;\red0\green0\blue0;}
\margl1134\margr1134\margt1134\margb1134\sectd
\pard
Document Two Content
\line
}
Merged Documents:
{\rtf1\ansi\ansicpg1252\deff0\deflang5129
{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}}
{\colortbl;\red0\green0\blue0;}
\margl1134\margr1134\margt1134\margb1134\sectd
\pard
Document One Content
\page
\pard
Document Two Content
\line
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With