Saving HTML from website with image src intact? - html

I have a simple HTML file that sits on my website. I use this with <div contenteditable="true"> sections and I edit the content on the fly and send it as an HTML email.
If something goes wrong, I save the file as HTML in case I need to retrieve the message sent on any given day.
The problem is saving the HTML from the browser to you computer will save the images and change the src in the file to that location in your directory. I'd like to avoid this behavior since:
I don't want copies of the same images saving every single day.
If I need to resend I can just open up that file from my computer, copy, and send in an email easily. But if I delete them from my computer, then the new src's will point to the wrong place.
So is there a way to tell Chrome not to alter the HTML when it saves and to not save images?

Type ctrl-u on Firefox or Chrome to view html source, then copy and paste to your text editor. Save file with html extension.

Related

compress html signature from brackets with images

Recently I designed a signature for a client.
The client then asked me to html it to him. I saw some video tutorials and I did it fine. I have the html file and the images in a separate folder.
When I preview it with Brackets editor, it shows me the desired result.
When I open the HTML from my Windows Explorer,
the result is also the same as in Google Chrome.
My main problem and question is:
How will I be able to send the HTML to my client without sending the HTML file and the images together.
I want him to be able to click only one file and preview it in Chrome and copy the code in his mail. Is there a way to compress the HTML file and the images from my folder and create a file only that will have both?
Thanks in advance.

How to save an HTML page in a PDF whit a button?

Hi guys i need to save my HTML page in a PDF file how i can do that ?
Function or external app?
this is one example of my page:
|
v
Can anyone link me a tutorial? it's my first experience with these things
i need to store the pdf in a directory in the server .. whit window.print() user must click Print in the layout... i want a function that print in automatic without any user action
If you want to add a button to save a page as PDF, you might just assign window.print to the button. All of the modern browsers will allow the user to save document as a PDF from the print dialogue.
EDIT: for storing PDF on a server you may use a library like html-pdf

Hardcode file data into webpage for download

I have a pdf document, whose path i have hardcoded into my webpage.
I also have a download link, clicking which the user can download the file.
<a href="Path\to\file" download>Click</a> (Works in HTML5)
However instead of having to carry both the webpage code and file separately, is it possible to incorporate the file data into the webpage itself and form a downloadable file whenever the user clicks on the link?
You can try to base64 encode that file and add it as link url:
DOWNLOAD
But adding file source to HTML is worst thing you can do. Why you need that? Your HTML will be loaded very slowly. CTRL + U and console debugging will be extra slow.

Web page not save correctly in google chrome browser

When I try to save a web page using the format "Web Page, Complete," half of the time it only saves the the folder containing the style sheet and images, and the .html file is not saved anywhere on my hard drive. How do I correct this? I have noticed it also happens when I use Safari, so it is not just an isolated issue with Google Chrome.
First save the whole page (webpage,complete) which may only save the folder containing the style sheets and images, again press CTRL+S to save the page but this time select to save only the HTML page by clicking on- (webpage,HTML only).
When directory is saved but not the file, try the following:
In "File name:" include the .html extension (example:
SampleFileName.html), and
Select Webpage, Complete in "Save as Type:"
Seems to fix the bug.

Create a Sharepoint page from HTML file with images

I'm trying to create an editable page in Sharepoint. I already have the page in HTML (it's quite large) and it has many images in it. Previously I have just created a new page in sharepoint and pasted the HTML source in, the uploaded/inserted the images manually, one at a time.
Unfortunately, I am not able to do this in a reasonable amount of time since there are many images this HTML file is using.
So, I want an editable Sharepoint page that keeps the images intact from a directory that looks like this:
thepage.html
1.png
2.png
...
...
...
343.png
etc
Any ideas?
EDIT: For more clarity - this is a specifications document in HTML form, so it has a lot of text and header integrated with images. I'd like it to be converted to an actual Sharepoint Page that is editable from Sharepoint's interface.
Seems best here to use a low-tech solution, some HTML editing and use the best way for you to upload multiple files.
Assuming
C:\mypage
-> \page.html
-> \images\1.png
-> \images\2.png
...
-> \images\100.png
Via the UI
Go to a Document or Image library, and use the "Upload Multiple files/images" (this only appears on Internet Explorer)
Lets say you uploaded it to //sharepoint/myimages
Create a new content page (say an Article page, or WebPart Page with a Content Editor WebPart)
Lets say your page resides now at //sharepoint/pages/mypage.aspx
Change your html to point from <img src="images/1.png" /> to <img src="../myimages/1.png" />
Edit the HTML for your newly created page (Ribbon > Edit HTML Source), paste your HTML code
Via SharePoint Designer
Drag and Drop all the images in your desired location
repeat the HTML steps above
To replace text in bulk, SharePoint Designer, your favorite HTML editor or event Notepad can do that well using the CTRL+H menu / Edit > Find & Replace options.
NOTE: the //sharepoint address up there is the http url for your site, SO won't let me use a full fake address as a sample.
From IE or from Word, save the page as a complete webpage so it creates an HTML file plus a folder with the images.
In network places, create web folder (WebDAV) pointing to Sharepoint. This way, you can access it from the file system in Explorer.
Open your new network place, navigate to the library where you want your HTML file to be, and drag-n-drop the file and folder into there.
The file then will be visible in browser, with the pictures, but the folder will be hidden.
If I have understood correctly your question. You can use this post answer to load list of images by javascript and php ->
Load list of image from folder.
Upload files to Share Point server and use that folder.
Or you can dynamically write c# code to read Share Point folder and display images.