|
There is a lot of code there. Have you examined the rtf files themselves and tried to print them from word?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
My applicaiton is independent. I don't want to depend on MS word. I have even set to
Graphic.SmoothingMode = SmoothingMode.HighQuality;
Graphics.InterpolationMode== InterpolationMode.HighQualityBicubic;
but no success. I looked in some article tooo but doesn't solve my problem when am printing RTF format text.
Thanks for replying
|
|
|
|
|
Actually the point was verification of your code. Does word open the rtf file fine? If yes then examine your rendering code, if no examine your rtf creating code.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Hello,
The code below I have:-
static string filename;
static XmlDocument xmlDoc;
and open the XML file in the Form Load.
If I remove the :- if (testDialog.ShowDialog() == DialogResult.OK)
Line the XML addnode code works OK. With the ShowDialog() line in the XML node add code does not work. Why?
Also is there something I can check (return code?) to make sure each part of the add node lines of code has worked?
void Button1Click(object sender, EventArgs e)
{
NewForm testDialog = new NewForm();
if (testDialog.ShowDialog() == DialogResult.OK)
{
MessageBox.Show("Here");
XmlNode root = xmlDoc.DocumentElement;
XmlElement childNode = xmlDoc.CreateElement("ABCD");
XmlElement childNode2 =xmlDoc.CreateElement("Name");
XmlText textNode = xmlDoc.CreateTextNode("ABCD");
root.AppendChild(childNode);
childNode.AppendChild(childNode2);
childNode2.SetAttribute("Name", "Name");
childNode2.AppendChild(textNode);
xmlDoc.Save(filename);
MessageBox.Show("Here2");
}
testDialog.Dispose();
}
Thanks is Advance,
Rapier
|
|
|
|
|
Does your NewForm return a DialogResult anywhere in your code? Supposing that the NewForm form has been created by you.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Hello everyone,
I have a string which contains all sort of charateres. How can I remove the unwanted charaters and make sure what I am left with is Numerical and Alphabet charaters?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Use the Regex.Replace method.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Let's say i want to write code using my own syntax for some reason unknown to mankind, and then generate C# code from this mysterious sourcecode.
Do you guys know if there are there any already existing programs wich can translate an user defined syntax to C#?
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
|
|
|
|
|
laserbaronen wrote: Do you guys know if there are there any already existing programs wich can translate an user defined syntax to C#?
They are called language parsers. You may find it better to translate it to IL rather than C#.
|
|
|
|
|
Hm okay, are there any specific parser that is easy to start with? preferrably one that starts with C# settings so i can change specific parts only
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
|
|
|
|
|
laserbaronen wrote: are there any specific parser that is easy to start with?
Triangle, or Mini-Triangle - a training language produced by the University of Glasgow? There is a book about it. (This is not an easy subject and will require a lot of work)
There is also a book on languages parsers with the CLR (which is why I suggested parsing the code and spitting out IL) which shows you how to create a parser and generate assemblies.
|
|
|
|
|
I'm trying to create a System.Drawing.Image from a user supplied URL. My code is as follows.. I keep getting a "(407) Proxy Authentication Required" Error.
WebClient imgClient = new WebClient();
String imgURL ="http://www.blah.com/image.jpg";
byte[] imageByteArray = imgClient.DownloadData(imgURL);
MemoryStream ms = new MemoryStream(imageByteArray);
System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
|
|
|
|
|
|
I would like to check to see if an XML document is well formed without relying on exception based logic. (ie no try catch block), ideas? XmlTextReader does not seem to work as it will only throw an exception.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
|
The Validating Reader in .NET relies on the XmlTextReader which requires the input to be well formed or it throws an exception. I would like to determine that a given input is not well formed without an exception.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
One way to do this would be to read the data in and generate a parse tree out of it. If you get any unbalanced elements, then it's not valid XML. This is a lot slower than just catching an exception, but it is doable.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
If there is a method that throws an exception then it is possible for a method to exist without an exception that does not suffer the performance penalty of exceptions.
Pete O`Hanlon wrote: This is a lot slower than just catching an exception
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: If there is a method that throws an exception then it is possible for a method to exist without an exception that does not suffer the performance penalty of exceptions.
I don't quite understand this. Sure there is an overhead when throwing an exception but surely badly formed Xml is an exceptional circumstance that should therefore be dealt with by raising an exception.
If you expect the Xml to be malformed (and you're therefore remembering not to control program flow with exceptions) then frankly you're not dealing with Xml - you're dealing with a string of data that sometimes looks like Xml.
I suspect this is the case, and you're being provided with a string of data that is sometimes malformed. This swings you back in a circle - because you can't change that process that generates the Xml (presumably??) and so you're back to an exception.
|
|
|
|
|
I am accepting user input which must be well-formed XML. From your post you do not make a distinction between application thrown exceptions and application driven exception flows. In both cases the user is presented with a graphical exception flow requesting better data; however, in one of the cases the underlying code is not dependent on a try catch but a series of programmatic statements.
This all leads down to the same path
if(!IsWellFormed(someXml))
is better than
try{
//Or other derivatives
XmlDocument document = new XmlDocument();
document.LoadXml(someXml);
}
catch{
...
}
J4amieC wrote: I suspect this is the case, and you're being provided with a string of data that is sometimes malformed. This swings you back in a circle - because you can't change that process that generates the Xml (presumably??) and so you're back to an exception.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ok cool. So the option you have as far as I see it is to write your own parser that does a few things, ie/
1) count elements to ensure balance
2) check common syntax errors like a missing quote on attributes
But something would stop me from doing this and just go with the method you've mentioned you dont want to use. Mainly as it seems like re-inventing the proverbial wheel.
|
|
|
|
|
No, I am just going to use a try/catch block. I just figured I would ask on CP to see if anyone knew offhand. I don't like using it but I am definitely not going to spend the time writing my own parser.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: If there is a method that throws an exception then it is possible for a method to exist without an exception that does not suffer the performance penalty of exceptions
I agree - except for the fact that the inbuilt .NET parsing was designed to throw an exception if it encountered an error. The point that I was making is that, coding wise, it's a lot more expedient for you to catch the exception because this means that the input was malformed - i.e. is exceptional.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi! All
I m playing to Enterprise Library May3.1; I encouter an error while validating properties "Could not load file or assembly". or "invalid assembly or codebase";
And i encounter an error at design time "
at the code ValidationResult r - Validation.Validate(customer);
the error is: Could not implicity convert Microsoft.Practices.Enterpriselirary.ValidationResult into Microsoft.Practices.Enterpriselirary.ValidationReuslt;
so how i tackle to these problem any suggestion will be anticipated.
|
|
|
|
|
I am using clickonce to deploy an application.
This works fine on my test machine where I develope .net applications.
Now I would liket oinstal it on other machines which do not have .net framework installed.
How do I add the .net framework to clickonce during instal please?
|
|
|
|