I want to display font dialog box in my web application(asp.net). Im using the following code. Its working fine.
Problem:
Dialogbox is getting open but it is behind the page. Even though i closed the application it is still open. It is not binded to the application.
Code:
FontDialog fontDialog = new FontDialog();
fontDialog.ShowColor = true;
DialogResult dR = fontDialog.ShowDialog();
if (dR == DialogResult.OK)
{
txtChange.Font = fntDialog.Font;
}
Edit:
I want to create an application for Entry pages to fill the database.
In this i want to store text and its font size, name and color.
Im my mind there are two options:
Displaying the fonts from the system.(Dropped bcz these entry page application is in the one system and the report page application going to run kiosk). It will create problem if the fonts are not available in the kiosk.
Font dialogbox.(Also creating problem)
Please is there any other good option for this.
Er.... this is NOT a good idea. This dialog will launch on the server, which means if you are accessing this from a remote computer (which is more than likely), you'll never see the dialog, but the server could end up with countless dialog instances popping up.
What use is the fonts dialog in a web application anyway??
EDIT: To be safe, I'd produce a list of known fonts on the system and then simply list them in a drop down box. You've already discovered the problem with enumerating the fonts and attempting to use a dialog.
There are lots of Html font coloring panel free over web , written in javascript. For setting values of Font Sizes you can use a dropdown for the same with your predefined values. While saving , save the value of font size and its concerned data as plain text in db and while fetching apply it.
Related
Hi i am having a strange requirement where Client wants the PDF to be User interactive(.i.e to have fillable form fields) like entering the name in text box inside pdf and several other fields. we usually work with Activereports 9 to generate reports. I have searched a lot its not possible with Activereports9 and i gone through iTextframe library and started working with it but no clue how to get required functionality.
I was sucessful to add the textbox to the pdf but co-ordinates to place the textbox on the pdf am facing trouble.
my code is like this,
iTextSharp.text.pdf.TextField oTextField = new iTextSharp.text.pdf.TextField(oPdfStamper.Writer, new iTextSharp.text.Rectangle(171, 195, 562, 404), "txtName");
Need asssitance guys,using any other tool or iTextFrame how i can achieve the functionality.
I am very new to c#/WPF and I need help with what should be a very simple app. In the app I am designing a user simply browses for a .txt or .jpg file which is then loaded. I would like the user to then be able to print what's displayed. The code I have found to work appears to only print part of the contents on one page. In addition, when the .txt files are printed there are no margins and the text seems to go right off the page. Here is the code I am using as it seems to be very basic.
System.Windows.Controls.PrintDialog pd = new System.Windows.Controls.PrintDialog();
if (pd.ShowDialog() != true) return;
pd.PrintVisual(textbox2, "textbox2.");
I guess my question would be, how do I set margin spacing and allow for multiple page document printing? Any help would be greatly appreciated. Thank you.
To print text files you will probably want to use a FlowDocument, this allows you to set margins, pagination etc, e.g.
Printing a WPF FlowDocument
To print a JPEG, you can use PrintVisual, e.g.
Load image from file and print it using WPF... how?
I want to implement a continious printing of document.Please see image belowalt text http://www.freeimagehosting.net/uploads/c87bde9396.png
When I choose the checkboxes then click the print button, all the information of a particular applicant will be printed.Take note that each document was printed on a new page. I found a soluton from this forum http://bytes.com/topic/asp-net/answers/861073-print-multiple-files-continuously
But I need an additional resources about this to implement the best solution for this functionality.Any ideas?
I believe that the best approach for this problem is to open a popup window with the contents using page break when necessary. This way you have better control over what is printed and you can give user a chance to review what is going to be printed if you like or call window.print on ready.
An existing process uses the Adobe Acrobat COM object AFormAutLib to open and fill form items. There are over 500 forms, and they all have a form field of type Button at the top. The method AFormAutLib.setButtonIcon is used to set the path of another PDF file to be used as the image on the button.
I am looking for an alternative. I have looked at iTextSharp, activePDF Tookit, and others, but have been unable to find anything that can replace this functionality.
Thanks in advance.
The solution was to use activePDF Toolkit in a different way...
APToolkitNET.FieldInfo myFI = aTK.FieldInfo(x.Key.ToString(),1);
aTK.PrintImage(logoPath, myFI.Left, myFI.Bottom, myFI.Width, myFI.Height, true, 1);
aTK.DeleteFormField(x.Key.ToString());
The button had the right location and dimensions, so the FieldInfo class is used to get those values. Then PrintImage is called with the path to the image and the locations, before the button is deleted.
Here's what I am trying to do:
Select text from a webpage I pulled up using my web browser control.After clicking a button while this text is still selected I would like a message box to pop-up displaying the text that was highlighted by the user. How do I get this functionality to work in my wpf application?
I think I'm on the right track using mshtml but I get an error that says:
Error HRESULT E_FAIL has been returned from a call to a COM component.
This error will happen even when I try something small on the document like changing the title.
The code is below:
IHTMLDocument2 doc = (IHTMLDocument2)this.webBookText.Document;
doc.title = "l";
Well, for starters it would be a lot simpler to use WebBrowser than mshtml (note that you can still host WebBrowser in WPF) - this will certainly let you do simple things a lot easier:
webBook.Document.Title = "foo";
However, I can't see anything there that would let you work with selections very easily...
You can get the selected element with .Document.ActiveElement, but this is the entire element - not the selected portion.
Figured it out that error was because this wasn't in my form class