VSIX - Embed WpfTextView in custom window - visual-studio-extensions

Does anybody know if it is possible tot embed the built in text viewer of Visual Studio into a custom WPF window? The text view should contain a custom text, that's not necessary linked with another textbuffer or file. We would like to have syntax coloring and intellisense for C# and XML languages.

Related

No Intellisense for Angular/Bootstrap in ASPX files on Visual Studio 2015

I do get Intellisense with editing plain HTML (*.html) files in Visual Studio 2015. I mean that I get proper autocomplete when I type in a ng-* attribute or a Bootstrap style.
But there's no way to get that when I edit a Masterpage or a regular ASPX page. No autocomplete and the tags gets underlined (not recognized).
What am I missing to get it working ?
Thanks for your kind help.
Popal

Removing the byte order mark on asp.net page

I'm really stuck. I'm working on an integration project where I'm creating a html fragment using ASP.NET. This fragment will be included as part of another site. The html fragment is created using a simple ASP.NET page with a minimal code behind file.
Te site that will include this html fragment is running PHP. The developer there is complaining that my code is sending the byte order mark as part of the html fragment and this is making his life difficult.
I'm using Visual Studio 2010 for development. I've saved the relevant aspx and aspx.cs files as UTF-8 without signature. However, this doesn't seem to have made a difference and now I'm pretty much out of ideas. The rest of the site is set to use UTF-8 as standard (defined in web.config).
Where should I be looking to alter the BOM behaviour for my aspx file?
If you save the file in Visual Studio I believe it will keep adding the BOM. You need to use a different editor to remove the marker such as NotePad++.
Actually in the advanced save as dialog in Visual Studio there is also an option to save UTF-8 without signature. Have you tried this?
It's confirmed in this question.
You can also use plain old NotePad to save with a different encoding.
Save As...Encoding DropDown.

Asp.net how to convert HTML page to PDF

I have read all the related links to this question but nothing show what i want :(
so i am asking :
Now i have a HTML page and i need to make a link or button to convert this page to pdf
so is there any FREE dll that i pass the HTML to it and it returns a PDF.
hint: i am using vs2010, MVC3.0, c#4.0
Personally I am using the following Java library where I compiled the .jar into a .NET assembly using the IKVM.NET Bytecode Compiler.

Using PDF In .Net App

Can someone point me to some code/tutorial on how to upload pdf files and store them, then moreover how to use a pdf reader to display the file as read only in an asp.net application.
Is there a PDF reader already in the visual studio toolbox?
The approach I would use in this situation is to upload the PDF as you would any other file, then use a tool like GhostScript to convert the PDF pages into image files that you can show in ASP .Net.
Here's a tutorial doing that in C# http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx
Adobe provides (on acrobat.com) a free service which provides you with the ability to upload pdf (and also other types like doc...) and then embed a nice flash interface for displaying the files on your page.
It's pretty helpful as you can store some 5 gigs of files here.
But if you want to let the users upload their own files then this won't help you.
PDF is a final format file, ie its is read-only for the most part and can be embedded into the page via the <object> tag, except if you mean downloadable by the user.
Displaying PDF is generally done by rasterising to an image format for display (ie as an image on the page or via a richer interface (with zooming etc) through flash/silverlight etc.
You can use [GhostScript][1] to interpret PDF files and convert them to an image.
[1]: http://www.GhostScript .com
Uploading a PDF is just like any other file. Use the ASP.NET file uploader control:
http://www.codeproject.com/KB/aspnet/fileupload.aspx
In order to view the PDF in an ASP.NET application, you could either depend on Acrobat being there or use a PDF Viewer control.
The company I work for, Atalasoft, sells a PDF Reader add-on to our web viewer controls. You can learn more here: http://www.atalasoft.com/products/dotimage/pdf-reader

How can I create new PDF files based on a template where some text will be replaced?

I'm developing a CMS aplication in ASP .Net using WebForms and I'm looking for a way to create new PDF files based on a template.
This feature will be used to generate contracts where some placeholders will be replaced with the customer data.
What's the best approach to do that?
Edited: The templates will be static, the main content will never change from customer to customer, only some text in the beginning that will contain the placeholders to recive the customer data. The catch is that I must allow the owner of the application to upload new templates in PDF, with the predetermined placeholders in it to allow the replacement to occur.
I can think of two approaches depending on what type of template you are looking at:
1) Static Template - Say the template does not change with the data (Ex.some standard compliance form etc)
You can try something like iTextSharp, where you have your templates defined in your .net code, and you just "plug in" the relevant data and render the PDF via iTextSharp.
2) Dynamic Templates - Say your template isn't standard and is user customizable. In this case, I'd say go for HTML for designing and "print" the for to PDF. There are many components available.
You may also want to try out components like crystal reports.
I'd go with static HTML templates containing substitution tokens e.g. {FullName} which you can then replace with your data. Once you have created an HTML file like this, say in a StringBuilder, you can use PrinceXML or ABCPdf.net (www.websupergoo.com) to transform your HTML into a PDF.
I hope I am understaning this correctly but wouldn't using standard PDF Form Fields give you the functionality and features you require. Load the PDF template into Adobe Acrobat Full or Foxit Phantom and define standard PDF Form Fields on top of the PDF. Each field has a name, position, font etc.
Then just use a standard PDF library to fill in the PDF form fields and 'flatten' the form fields if that is required.
This solution allows the customer to design new PDF layouts and so long as they define form fields with names that match up then you will be able to drop in the replacement form with a simple file copy.
The iText or iTextSharp library should be able to do all of this quite easily. If not them there are many PDF libraries out there that can.

Resources