How Can I Read An HTML Document And Extract Image Names? - wpf

I'm developing an application in WPF, C# and VS2010 and am not sure how to proceed with this...
I am interested in an algorithm to obtain all the .jpg and .bmp images that are referenced within an html file. How can I extract the body from within an html file?
Thanks

The HTML Agility Pack is a pretty solid library for extracting elements from an HTML document. A simple view is to see it as a wrapper over XPATH with a nice API.

You can do it with regular expressions.
http://msdn.microsoft.com/en-us/library/ms228595.aspx
The following pattern should work:
(http?:\/\/.*\.(?:png|jpg|gif))

Related

WPF Form based on XSD

I am new in WPF and want to create a UI using XSD that autogenerates the controls.
See screenshot
Just write proper XSLT for your XSD.
XSD is valid XML so it can be parsed with XSLT to get any other document. Because XAML is valid XML it won't be so hard.
You can find examples of XLST transforming XML to HTML and start from them. It's easier and gives immediate feedback if your XSLT is good.
Here you can find whole project to convert XSD to HTML form.
EDIT:
As it was suggested you can load your XAML in runtime but I think more convenient and handy will be generating it at build step. See this answer and documentation to get more details.
Yes, XAML is valid XML and can be transform. But if You want transform and load in runtime You must read answer for this topic
You may use InfoPath to design a Form
with Your XSD as starting point
and save the design as Extract.
You will find a folder with InstanceSample, XSLT and XSD.

How do I make LiveCycle understand HTML tags embedded in XML

I am using XML schema to bind data to LiveCycle PDF form.
How do I make LiveCycle understand HTML tags embedded in XML.
Your question is a bit vague. Typically, we dont use HTML tags contained in XML as they are typically contained in a CDATA tag. Can you please elaborate more and possibly paste sample XML data as well.
Thanks,
Armaghan.

How to create PDF on Silverlight 4

I need to create & display a PDF document in Silverlight 4.
PDF document will be generated dynamically.
The PDF document will contain plain text & some images.
Is there any API I can use to achieve my requirement ?
You can use this: http://silverlightpdf.codeplex.com/
Yes! We create PDF Document. In silverlight By using PDFSharp.dll.
It's Opensource dll file.
You can download the dll file below Link
http://www.pdfsharp.net/Downloads.ashx
Please click below link for reference puprpose.
http://www.pdfsharp.net/wiki/Booklet-sample.ashx
as so many examples as given its easy to understand.

Show pdf inside silverlight application. PDF to XAML

I need to create silverlight application where customer will see some pdf files.
PDF files have to be inside silverlight control and not rendered as images (customer wants to select text)
For this purposes i need some free libriaries or code to convert pdf file to xaml (or just open pdf so i can convert it to xaml).
Which library can read pdf and help me to convert data to xaml?
Can I read somehow pdf file and write custom convertation tool?
I saw iTextSharp. Is this library can read pdf and help me with my issue?
I will be thankfull for any ideas or links.
I make use of the Acrobat Reader plugin to do the displaying for me. It does require a different method depending on whether your application is running inside or outside the browser (I check if the application is running inside the browser and change the means of display accordingly). If running inside the browser, I overlay the application with an IFrame, as I describe in this article: http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx. Otherwise, I use the WebBrowser control. I have a control which does this all for you in the source code that accompanies my book, which is downloadable from the Apress website here: http://www.apress.com/9781430272076/.
Hope this helps...
Chris

Can we use CSS in a Silverlight project

I have a problem. I want to make a web application using silver light. I just want to know that can I use a css in this, because I read the the designing of silver light is in the xaml or we use css with html tag.
Is anybody clear my confusion?
Thanks
Silverlight XAML ≠ HTML+CSS
These are all different technologies. You probably better know Adobe Flash. Well Silverlight is very similar. It (may) run in the context of a browser, but it has nothing to do with HTML and/or CSS. It uses XAML files (as you pronounce them zammel). So if you decide to write a Silverlight application you will have to use XAML files and use Expression Blend to design your UI. Doing so would be faster than hand editing XAML files.
xaml is like html + css but its not the same , they have some things in common but nothing much important .
Better find yourself good video tutorials or a book and learn it from there :)
No you can't really use CSS in a silverlight project.
If it's worth the effort, what you could do is manually load the required CSS files with the WebClient class and parse them to style your controls accordingly.
Someone did something similar with the Sharepoint theme files, which are yet another format. Using SharePoint thmx files to style Silverlight describes how to do it. Maybe you can find some inspiration from that.

Resources