|
awesome !!! thank you so much.. it works !
|
|
|
|
|
I want to build a C# application with integrated acrobat reader. I will have a list of the left hand side which is a list of links of pdf files I have on my computer and when I click the required pdf file link on left, pdf file must display on the right hand side of the application inside a pdf reader. I am currently having 100 pdf files for my literature review ( I am a PHD student ) and it has reached a state where its unmanagable.
I am a pretty OKAy coder in C#. But I simply don't know how to go about this.
Any help will be highly aprreciated.
Regards,
Amit
|
|
|
|
|
there are alot of options available for you to read a pdf file. Infact Listing the PDF in your application is not a issue than reading a pdf file.
You can use Acrobat SDK & Documentation for this. Infact it is not OpenSource but i downloaded (for Free) this SDK once when i needed to include javaScripts in PDF Events.
Secondly Check ITextSharp (OpenSource), PDFToolKit (Price 299 $), or PDFLib (dont know price).
I recommend you to use Acrobat SDK or ITextSharp
R A M
|
|
|
|
|
Dear Ram,
Thank you very much for that. I think I will stick with the ItextSharp.
I can extend this to any application, like powerpoint, word and excel etc.??? I mean if my file is not pdf but also consists of .doc, .txt, or . ppt, .xls?
Regards,
Amit
|
|
|
|
|
yeh you can use this library for TEXT,HTML,PDF(CODECS ALSO INCLUDED LIKE WMF),RTF DOCUMENTS,XML,GZIP,TAR,ZIP.
I am not confirmed about PPT and DOC. but ITextSharp Includes the Bouncy Castle (open Source) Library which is related to Security you can create digital certificates and signatures using Abstract Syntex Notations like X 509 X9 more over you can use it for SMIME Implementation.
Regards
Rizwan Ahmed Malik
R A M
|
|
|
|
|
Hi all,
I want to expose some global strings/ints so I wondered should I be using public const int i = 5; or public static int i = 5; ? Thanks.
Regards,
gamehack
|
|
|
|
|
It depends. Will this data be used within a class instance ? If so, no need to make it static. Are static and const mutually exclusive ? I don't think so. I think it should be const no matter what.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks
|
|
|
|
|
Be aware that "const" is resolved like at compile time like a C/C++ define. This means that if you change the value, other assemblies will still have the original value. "const" is fabulous for internal data, but lousy otherwise.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
A constant can not be declared as static. All constants are static.
A constant is not a variable as such but rather a compiler directive. Unless the constant is an object (e.g. a string), it's never stored as data.
If you declare a constant:
const int foo = 42;
This line:
bar = foo;
will produce exactly the same code as:
bar = 42;
---
b { font-weight: normal; }
|
|
|
|
|
Hi there.
I am wondering how to draw on a form. I have one form (f1) that has a button. When that button is pressed a second form (f2) springs up. I want to be able to draw on that form (f2). How do I do that?
This is what I did:
Graphics g = CreateGraphics();
Pen pen = new Pen(Color.Black, 2);
Point p3 = new Point(40,125);
Point p4 = new Point(55, 125);
g.DrawLine(pen, p3, p4);
g.Dispose();
I don´t get anything from this so I was wondering if someone can please help me?
Thanks,
FJ
|
|
|
|
|
Always tdo the painting in the OnPaint method:
protected override void OnPaint(PaintEventArgs args) {
Graphics g = args.Graphics;
Pen pen = new Pen(Color.Black, 2);
Point p3 = new Point(40,125);
Point p4 = new Point(55, 125);
g.DrawLine(pen, p3, p4);
}
With this code the line will be drawn everytime the form is redrawn and thus make sure it won't go away when the form refreshes.
|
|
|
|
|
Thanks for the help.
Your version draws the line on the underlying form f1 instead of on f2 like I wanted. How do we fix that?
FJ
|
|
|
|
|
Place the code in form f2 instead of f1?
If the code needs to be in f1 then try binding the Paint event of f2 in f1.
|
|
|
|
|
Hi.
I have a stupid question about editing database tables. I have runtime created dataset dsStuff, and runtime created table "items" within it. "items" have primary key field - ID. I need to create modal dialog to edit row from "items" with given value of ID. And I can't figure out how to tell some textBox that I need to edit row with given ID.
Thanks in advance.
|
|
|
|
|
Pass the ID into the constructor for the dialog, assuming that all editing happens in the dialog.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, I want to extract data from an HTML Web Page, which .Net Framework classes I should use to perform that?
|
|
|
|
|
What exactly are you extracting? You might find Regex[^]es to be useful for parsing purposes.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
if you want the html code from a page you must do this:
<br />
using System;<br />
using System.Net;<br />
using System.Text;<br />
using System.IO;<br />
<br />
<br />
public class Test<br />
{<br />
public static void Main (string[] args)<br />
{<br />
HttpWebRequest request = (HttpWebRequest)WebRequest.Create (@"http://www.site.com");<br />
<br />
request.MaximumAutomaticRedirections = 4;<br />
request.MaximumResponseHeadersLength = 4;<br />
request.Credentials = CredentialCache.DefaultCredentials;<br />
HttpWebResponse response = (HttpWebResponse)request.GetResponse ();<br />
<br />
Console.WriteLine ("Content length is {0}", response.ContentLength);<br />
Console.WriteLine ("Content type is {0}", response.ContentType);<br />
<br />
Stream receiveStream = response.GetResponseStream ();<br />
<br />
StreamReader readStream = new StreamReader (receiveStream, Encoding.UTF8);<br />
<br />
StreamWriter w = new StreamWriter("ciao.txt");<br />
w.WriteLine(readStream.ReadToEnd());<br />
<br />
Console.WriteLine ("Response stream received.");<br />
Console.WriteLine (readStream.ReadToEnd ());<br />
response.Close ();<br />
readStream.Close ();<br />
Console.ReadLine();<br />
}<br />
}<br />
i hope this it was you wanted
|
|
|
|
|
If you're only going to be extracting a small range of data from the page, I'd recommend using regular expressions. Otherwise, you should probably use SGMLReader[^].
|
|
|
|
|
Hi, Ive posted on this board before but in the Visual C++ area.
My Question is :
In my previous questions, I created a new EditBox Class Called CInitials
and changed the OnChar Message to append a '.' after each keypress.
The code for that was done like this:
<br />
void CInitials::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)<br />
{<br />
if (isalpha(nChar) )<br />
{<br />
if ( islower(nCHAR) )<br />
nChar -=32;<br />
<br />
DefWindowProc(WM_CHAR, nChar,<br />
MAKELONG(nRepCnt, nFlags));<br />
<br />
nChar = '.';<br />
DefWindowProc(WM_CHAR, nChar,<br />
MAKELONG(nRepCnt, nFlags));<br />
}<br />
<br />
if ( nChar == VK_BACK )<br />
{<br />
CEdit::OnChar(nChar,nRepCnt,nFlags);<br />
CEdit::OnChar(nChar,nRepCnt,nFlags);<br />
}<br />
}<br />
The CInitials Class was derived from the CEdit Class in Visual C++.
The question is, can this be done in C#? If yes how?
Thanks again
Tom
|
|
|
|
|
Pretty much the same way, but instead of the VK enum, you have the Keys enum, so Keys.BackSpace or something like that. The messages are the same ( seeing as it's still a window underneath it all ).
Stuff like IsLower is in the Char space, so Char.IsLower(myChar)
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian,
How do you edit OnChar Messages in a C# EditBox?
Tom
|
|
|
|
|
There's either an OnChar or an OnKeypress, just type public override, and the ide will give you a list to choose from.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi there
I need to ask something really urgently. I need to be able to send a file over the serial port to a PIC programmer. how do i go about doing that?
I have simple serial communication working at the moment. I am using C#. the only thing with that is that if i send a 'p' i get back the hexadecimal value of 'p' instead of getting the character so how can i do that?
i am using an already created class for my serial comm in dotnet 1.1.
another thing is that i want to xor the file or perform simple encryprion on the file so how do i go about doing that? I am using windows forms in this case so am not sure how to xor a file or perform simple encryption on a file.
Pleas help me urgently.
thanks
|
|
|
|