SautinSoft HTML-to-RTF and UNC Paths - c#

Has anybody successfully used the SautinSoft HTML to RTF DLL which has images with a UNC path?
When we use the component to transform a HTML document with images whose src attribute is pointing to a UNC path the resulting RTF document has the images missing.
When navigating to the HTML page directly - with UNC paths as the source - the images are displaying correctly.

This is no longer relevant as we've moved onto using Aspose.Words as the tool to export the HTML to RTF format - from first impressions it appears (a) a lot more flexible, (b) easier to read, and (c) has proper documentation.

My name is Max from SautinSoft, the current version of the HTML to RTF .Net component supports UNC paths. Thanks for noticing about this issue!

Try wkhtmltopdf
http://code.google.com/p/wkhtmltopdf/

Related

View content of a .resource file

I have a .NET executable and I need to view the resources attached to it. I extracted .resource file from .NET executable using DotNetResourcesExtract utility but I don't now how to view content of .resource file.
Could someone explain how to view this file?
Not sure you're using it correctly...
Assuming your storing images there.
You can simply do:
Image resfile = ProjectName.Properties.Resources.resourceName;
So if resfile is an image, you can put it into an Image control.
so, if you have an image control on your form you can simply do:
imageControl.Image = ProjectName.Properties.Resources.resourceName;
If it's a text file or any other type of file - again, you can access it the same way. If it's a binary file, the ProjectName.Properties.Resources.resourceName will be a byte array, so you 'll need to load it in the correct manner.
Is that what you're wanting? Otherwise indicate what type of file are you trying to extract from your resource file.
According to MSDN The .resx (XML-based resource format) files are
converted into common language runtime binary .resources files
that can be embedded in a runtime binary executable or compiled into
satellite assemblies.
Getting to the point: How to view this?
Well, Since it's a binary file which contains resource(images etc.) therefore you could always use Windows resources editing/extracting applications.
eg. Restorator, Resource Hacker to name a few.
Meanwhile, have look at this Stackoverflow post. which sound almost similar.

Create single HTML / markdown file using Sandcastle Documentation

simple question here.
I'm using Sandcastle Help File Builder to generate documentation of a C# project in Markdown or HTML format. My issue is it's creating a separate .md / .html file for every item that's documented. Is there any way to force it to generate a single large file containing all the documentation similar to how Visual Studio outputs one single XML file, or at minimum using a directory system to at least structure the output a little better rather than have one folder with ~200 markdown / html files.
Thanks.
For the HTML part of the question, it is possible to open the generated index.html file in a browser (may need to enable scripting for the page to work correctly), then save it as a single file in MHTML format. According to the linked page, the current versions of most major browsers support MHTML nowadays.

How to cache web to read offline in webcontrol window phone

I'm using to load website follow code
webContent.Navigate(new Uri(linkURL));
I want to cache all content and html tag, style, js in web to read offline.
I tried download html source, file css and js using Webclient and replace these file to html resource then save to file "index.htm" but not good.
Can you find the way to resolve this issue? thank you.
The only way to do this is to download ALL the relevant files (including those referenced inside the HTML. eg. images, css, js, etc.) and save them ALL to Isolated Storage with appropriate similar file and folder structures.
The important point is that you also need to update all the paths within the content so that they point to relative paths that match where files have been saved.
You can then load the HTML from IsolatedStorage.
This is potentially a lot of work. I'd recommend exploring other options if possible first. Also remember to manage the files stored in IsolatedStorage appropriately so you don't just keep adding files there indefinitely.

VSTO: Is there any way to retrieve the original file name of a picture (InlineShape) that has been inserted into a document?

I am developing a Word Addin. There is a piece of functionality within the Addin that is required to retireive the original location of a picture that has been inserted into a document.
It doesn't matter if the Image file no longer exists in the original directory. I will handle that in the code.
I think there is no way to do this. I did had the same requirement to find the file name from the image in the document. So I had to insert the image with the file name in its alternative text description to achieve this.
The question got me curious, so I tried the following: add an image to a word document, save it, zip it and start looking into the xml document. The media folder contains the image as embedded in word, which at that point has been renamed and "forgot" about its origin. On the other hand, document.xml does contain a lot of information about the image enclosed in the tag, and that includes the whole path to the original picture.
I don't know if the Open XML SDK gives you directly access to this (doubt it), but worst case you should be able to get to it by digging into the file, assuming you are working with an already-saved file.
If the file is not saved yet, I don't know.
I know this is years old, but the full path of an image that has been drag&dropped into a document is available in the AlternativeText field of the InlineShape. Unfortunately you cannot get this value when it has been inserted with Insert Picture. Images that have been pasted probably vary on whether this is available, e.g. if it was pasted from a document where it was drag&dropped it's probably there, but otherwise it isn't.
This info comes from targeting Word 2010 with VSTO.

change html relative image paths to absolute in httpmodule

I have set up a .net http module to capture the html output of a page. I am looking to finding the quickest way to do the following:
Search through all the images (ie. img tags and input controls of type image)
Find those that have a relative source path
Manipulate the path by converting it from relative to absolute (I pass the absolute path to it)
Update the html source
Output the manipulated html source to users browser
Any suggestions as to the best way and more performant way of doing this? I am developing in c#.
You may want to have a look at http://htmlagilitypack.codeplex.com, it makes parsing and modifying HTML content really easy without having to resolve to a bunch of RegEx.

Categories

Resources