saving contents to a html file - c#-4.0

html contents are coming from the server in a xml file. i have seprated the html contents from xml now i want to save these contents to a html file. Please help me regarding this.

Would take only one line in C#: System.IO.File.WriteAllText( System.Environment.SpecialFolder.CommonDocuments + "myhtmlfile.html", "<html>...</html>", System.Text.Encoding.UTF8 );

Related

How to open a HTML file in a non-default file type application(browser) using python?

Does anyone know how to open a HTML file in a browser that isn't the default HTML file type browser?
You can use below code
webbrowser.get("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s").open("file/path/name.html")

Dropzone show only CSV & XLS files in dialog box

I used dropzone as CSV/XLS file uploader. I use this option to filter and restrict CSV/XLS file:
acceptedFiles: "text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
Now I just see XLS file in windows dialog box and doesn't see CSV file. Off course when I change filter drop-down to all files, I see CSV file and select it. But I wanna to method or option to solve this issue.
Do you have any solution for see both XLS/CSV files together?
Dropzone.js simply puts the values from the AcceptedFiles attribute directly into the html component.
<input accept="text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
It looks like text/csv is not an accepted value even though it is a valid mime type. .csv is recommended.
See here HTML Input="file" Accept Attribute File Type (CSV).

Node.JS HTML to PDF

I want to convert the HTML to PDF for which I am using this package (https://www.npmjs.com/package/html-pdf).
But in this HTML I am also getting tables and that tables can come in any position in HTML.
So I want to copy the table thead to another page if the table in the HTML exceeds more than 1 page.
Can you please help me on this.
Thanks in advance
You're going to have to modify the CSS of the page to properly handle a printable view.
See also: Repeat table headers in print mode
Try to use Puppeteer to create PDF from HTML
Example from here https://github.com/chuongtrh/html_to_pdf
Or https://github.com/GoogleChrome/puppeteer

How to cull dictionaries that is in between HTML Tags as an element?

How can I cull the {juicy_dictionary} from the scrapped HTML source where its tagged like
<div data-qa-id="doctor_card" class="u-cushion u-white-fill u-normal-text o-card o-card--separated c-list-card" data-reactid=*><script type="application/ld+json" data-reactid=*>{juicy_dictionary}</script>
Example: This page view-source:https://www.practo.com/delhi/doctors.
I am unable to think of ways of doing it. my scrapped file is saved as CSV where I saved all html source as-it-is in a CSV file.

JSP to Excel encoding problem. Value=?

Jsp page shows arabic character verywell as like this:
about something bla bla تضارب توقعات شهر أكتوبر فيق الـ و الـ
but when I export it to Excel and try to open it,Excel says:
The file you are trying to open 'example.xls' is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
After clicking yes, value is which I wrote before is:
about something bla bla ??????????????????????????
Jsp page has:
<%# page isELIgnored="false" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
if I copy arabic characters and paste it to Excel,Excel shows them clearly.
I use charset=cp1254.
when I change it to charset=cp1256, Value is like freak characters.
any ideas to fix it?
You're fooling Excel by a plain vanilla HTML file with the wrong extension. This is not going to work flawlessly, as Excel has warned you.
You need to serve a real binary XLS file using a Servlet, not some HTML table using a JSP. You can use Apache POI HSSF or JExcelAPI for this.

Resources