Copy object from an external applicaton and paste into aspx - c#

I have an custom developed application procured from a vendor. I am able to do a Ctrl+A, Ctrl+C in this application and Ctrl+V into Word or Pbrush. This gets pasted as an image. But I am trying to do the same onto ASPX Picture Box it does nothing. I have used the code from ASP Snippets for achieving this. It does not paste anything in to the picture box. I have also checked Stack Overflow but this talks about copying C# objects as per my understanding
I have opened clipboard using the WindowsKey+ V. This shows all the historical copied image and text from previous restart but not the copied object from the vendor procured application.
Kindly suggest / help / advice me on this

A image box, or picture box of some sort will not allow a cut + paste of an image.
However note how while I am answering this question, I am freely able to cut + paste in a image!
Thus, you need some kind of control on a page that allows/supports/enables pasting in of images.
Normally for reasons of security, this is not allowed.
You have to adopt some type of html text (HTML editor), that allows such opertaions (paste of content).
CKedit is a good possible choice.
I currently use the HTML editor from the ajax toolkit.
And thus I allow this:
So, in above, I allow the user(s) to paste in text, or as above shows, a image.
Now, when I display a Radiobutton list, I can drive the user choices from above.
So, above when user hits save becomes this:
And now I can use the above "list" of choices say like this:
So, allowing user to paste in "content" for parts of your website, or in above example say enter choices, but those choices allow users to paste in text (and/or graphics) means that your site can be driven by user supplied content.).
So, in both screen caps above, the first one is a editor that lets those doing the "issue tracking" create new "issues", and we allow graphics as part of that process.
And of course for the issue edit, note I was able to type in some text, but ALSO do a screen cpature and cut + paste in the screen shot (ctrl-v).
And note how THIS editor on SO also allows this.
So, in general a image control, or even a text box control does NOT allow pasting in as image + text.
However, the CURRENT editor on SO allows this, and you can in your applications also allow this feature. However, you have to adopt some kind of editor for this process.
As I noted, ckeditor is a popular choice.
https://ckeditor.com/
And the one I was using above is from the ajaxtoolkit for web forms.
https://www.devexpress.com/Products/AJAX-Control-Toolkit/
Both of the above choices are free to use.

Related

Using an editor like FckEditor in a form application

I am working on a contract management system on c# form application, one of the main parts of the project is to create a letter.
In this part of the application a user can send a letter with in the shape he or she wants, so I need an editor like FCK in html, because my users should be able to insert table insert image and etc.
Any idea how to get this working? Any concerns?
You could indeed use a HTML WYSIWYG editor, but depending on the quality of it, it might raise problems when converting the output of it to print. This may also depend on the framework used to generate the Word document.
In one of our environments, we use CKEditor and JasperReports. That combination is suitable to export to Word, since JasperReports supports reading HTML and convert that to Word.
However, the best solution may depend on your business requirements and personal preferences.
If the application is a business application, another option is to let them edit the document in Word. Our company (disclaimer: I am biased) has build a product that supports editing a Word document from a template loaded and filled from a database (or multiple databases). However, if it is useful to you depends on your business requirements.
FCK is history now and as mentioned by others CKEditor is the successor. TinyMCE would be another alternative, or any other might be..
But what I want to mention is along with possible printing issues (that I have never dealt with) I want to underline another aspect:
my users should be able to insert table insert image and etc.
uploading and inserting images might be another issue...they don't come with a built in uploader, they sell it. you have the option to buy CKFinder along with CKEditor and Moxiemanager along with TinyMCE unless you choose to handle upload and insert into the editor process yourself.

Displaying images or controls in Visual Studio source view

I'm working on a number-crunching app with some fairly (from my POV) complex math. My first thought was,
Gee, it'd be really nice to be able to take a screen shot in
Mathematica and include it as a comment in my C# source.
I see a cdata value when entering /// alongside summary, remarks, and other options. Custom tags appear to also be supported (as there doesn't appear to be any validation happening).
In order of preference, I'd like to:
Link Mathematica code to my C# source, and have said code appear, in all its Greek-laden glory, as a comment above the method that calls it (or from which it was generated). Bonus points for actually embedding the Mathematica editor in VS!
Link to an image file containing a screenshot of the above, manually generated via Paint and the snip tool, and have VS display it.
Embed the image in a CDATA section, and have it automagically render inside of VS when viewing the code, inline with said code. Generating a base-85 (or whatever) encoded version of an image is trivial. The problem at this point is getting it to display.
Ways that this is possible:
Write an app that overlays an image on the screen and, via magic, keeps it aligned with the source view in VS. (This is ridiculous, but, hey, so is a language that requires you to denote variable names with a $, and yet has a full BNF grammar available to anyone who can Google. Oh, what a world...)
I got nothing.
Suggestions? Is it possible to extend VS so that an image, or control (where Mathematica could be hosted), can appear in the source view?
(note: one of my favorite statements is "It's software. Anything is possible. Give me a 9-volt battery, a paper clip, pocket knife and a monkey hopped up on speed, and we'll make it happen." In this case, I mean within the realm of practicality.)
It looks like this Visual Studio plug-in should solve most of your requirements:
http://visualstudiogallery.msdn.microsoft.com/793d16d0-235a-439a-91df-4ce7c721df12

Control Printing in ASP.NET Page

I need to create a web application that prints checks. Because of the nature of the program, it needs to be very secure, and each action needs to be logged. I need to be able to generate a check, print a check, allow reprints if needed, etc.
I've got the generation of the checks completed. I've decided to make a PDF (so that i don't get any browser header/footer garbage). What I'd like to do is not even save that PDF to a file but to instead send the data directly to a printer. Basically, I'd like for the user to enter the amount of the check, select which account it's going to be printed for, then click a button that sends the data for that check directly to the printer. I don't even want the user to be able to view the PDF of what's to be printed.
Has anyone done something similar to this in ASP.NET?
Thanks.
[EDIT]
The original question I asked was answered with ActiveX controls. I, however, decided to do it a different way. Instead of printing a PDF, I've decided to create an image of the background of the check. I will then use that image (.jpg), and manipulate it by placing the appropriate text (MICR line, amount, check date, etc.) on it using System.Drawing.Graphics and stored X,Y coordinates and font preferences in my DB. From there, I can use the System.Drawing.Printing namespace to send the new .jpg file to a network printer from the web server, eliminating the need for an activeX control and further tightening security because the new image of the finished check is never saved, and the user never has access to the overlay of the check.
Thanks for your help.
If you look at how postal services tackle this problem, you'll notice that a simple web application won't do. To have control over how and when items are sent to the printer, ActiveX compontents or Java software is used.
[Edit]
Small clarification: I ment that the software has to run on the client-side as opposed to your suggested server-side suggestion.
If you want to go the .NET route, you're down to an ActiveX in Managed C++ or a Click-Once application that is launched from the web (allows more of the .NET language, but can be decompiled and altered).
We have implemented this scenario in a couple of ways. First, we have the traditional PDF solution, where the server generates the PDF print image, returns it to the browser which is then displayed via the PDF plug-in and optionally printed.
Second, we wrote a client-side ActiveX component to handle the print. Pass the input values to a backend web service which uses FOP to format the print into PCL. The PCL is passed back to the ActiveX component who then sends the PCL directly to the users default printer. No PDF required here.
Either way works, but only the second option - which will require you to implement some client-side piece - meets all your requirements.
There isn't really a way to do this. You can only send a document to the user which the user can then send to the printer. There are ways to prompt the print dialogue to pop straight up, but the web would be pretty insecure if you were allowed to control how data was managed on the user's machine.
NKCSS is right that it would require software actually installed on the user's machine. You have done as much as you can by making it a PDF that the user is prompted to print.
If you had the cheque as html, you can used styles to show/hide content just for the printer as discussed in this post: here
There's no way to do this completely securely. Even if you force the PDF to print directly to the user's default printer, that itself could be a PostScript or PDF printer like PDFCreator. So they could still get a viewable PDF in the end.

Editing Powerpoint Slide in C# Windows Form

I'm trying to develop a Point of Purchase sign creator.
The best way that I can think of going about this is using a powerpoint slide to create the POP.
The problem that I'm having with this is I can find pages after pages of information to open up a presentation, but I can't seem to find anything that'll let me open the actual powerpoint file for editing. The client will not need to make new textboxes or anything of that sort, but will need to be able to edit them.
Currently I'm using a web browser to view the ppt presentation but as I mentioned, it is merely a presentation.
private void Form1_Load(object sender, EventArgs e)
{
this.webBrowser1.Navigate("about.blank");
string path = "C:\\Users\\Test\\test.ppt";
this.webBrowser1.Navigate(path);
}
Thank you in advance
p.s. I do have Office Interop referenced in the project but it seems that everything is so situationally specific that I cannot find much information to help me out.
It would be good if you could provide a little more info on exactly how flexible the editing needs to be, and what version of PowerPoint you are targeting. From your question and approach you appear to be looking for access to all of the capabilities. This is not something that you are going to be able to do easily with your approach.
A few other options which might work for you:
Use the Open XML format and generate the PPT from an external data source. This seems a lot cleaner to me but you have less flexibility than your current approach. You would need to capture user's changes yourself and then generate the file to preview.
Copy a PPT file to a temp file and open it in PowerPoint for editing. Then allow the user to edit and update it. When they close the temp file capture it and bring them back to your main application. The user has full access to the PPT file to do what they want but you have a lot of edge cases to handle. eg. what if they close the file and don't exit PowerPoint etc.
Write a PowerPoint add-in that works with your application, and make some Ribbon customisations. The user will get the full PowerPoint experience but there will be custom support for your application on the Ribbon and the user can just click to have the finished PPT sent back to your application. This seems like it would be more maintainable than option 2 since you are probably going to use more standard APIs and a user has to click your "finish" button to complete the process meaning that you have a clearly defined end point instead of watching for user behaviour that you could miss.

Microsoft Office Word in a web browser

I want to have a Microsoft office word inside a web browser so that i can get the control to format the text and specify proper indentation. I don't want a client side to save the document.
It should be the same as http://www.asp.net/ajax/ajaxcontroltoolkit/samples/htmleditor/htmleditor.aspx but i want an additonal component i.e RULER to it.
Is there a way i can get that kind of control or a MSword control without save button.
Please Help
You won't be able to get a "Word Control" into a webpage (not least since that requires every user of your site to have a copy of Word installed), but you can look into something like CKEditor, which is a WYSIWYG editor written in Javascript/HTML. Getting a ruler in there may be difficult though.
What are you trying to do? I'm not sure what your question is, but what you are referring to is a WYSIWYG editor. There are many versions and options for embedding one in your web page. You mention one already. Here's some more:
TinyMCE
Markdown
YUI Editor
Yes, there is such a MS Office control called aceoffix. It works like calling MS Office from local machine and embeding it in web browser. Users can edit,view and save document online diretly. Developer can also customize these functions, such as disable the "save" button.

Categories