corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Saving HTML as XHTML


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Saving HTML as XHTML
Rob_Quads
Member

Registered: 29th Mar 01
Location: southampton
User status: Offline
   24th Apr 12 at 09:08   View User's Profile U2U Member Reply With Quote

Anyone know of any software or browser that will save a HTML page as a single XHTML page?

Got a html document I want to publish but the powers at be only like single file documents. The HTML has lots of embedded jpgs which when you save as a web page in most browsers get saved in a sub-directory. At the moment they want a PDF which looks horrible due to the tables splitting across pages (don't get me started on preventing that)

I've found a few HTML to XHTML programs but all it does is make the HTML conform to XHTML syntax not embed the actual images.

Ive looked at MHT files but there are too browser specific.

Any suggestions?
ed
Member

Registered: 10th Sep 03
User status: Offline
24th Apr 12 at 09:14   View User's Profile U2U Member Reply With Quote

Huh, HTML is XHTML and XHTML is HTML (as far as this question's concerned). The images are never embedded within a page, they're always pulled in as individual files using an img tag.

The reason why you're having problems saving the web page to PDF is when the PDF is generated, it's effectively printed. This means that the print styling is applied to the page and as most websites don't define a print style, the browser default is used - this tends to break layouts.

One other options would be to save the web page as an image using Print Screen and pasting this images into paint or something.
Rob_Quads
Member

Registered: 29th Mar 01
Location: southampton
User status: Offline
24th Apr 12 at 09:35   View User's Profile U2U Member Reply With Quote

Can you do Base64 Encoded Image Url in HTML? I thought that sort of thing only came in XHTML files

i.e. where the image is stores as

<img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub/
/ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExK
cppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7" />

Edit: Looks like you can do these. From what I had seen I thought these were some of the extended features in XHTML that was not in HTML.

So the question is, is there an application that will embed the images from a 'normal' html page?

[Edited on 24-04-2012 by Rob_Quads]
ed
Member

Registered: 10th Sep 03
User status: Offline
24th Apr 12 at 09:39   View User's Profile U2U Member Reply With Quote

Yes you can, but why do you have to include everything in one file? Your page is going to lag a bit when loading if you're trying to do everything at the same time, plus you can't cache the images to reduce load the next time the user visits.
Rob_Quads
Member

Registered: 29th Mar 01
Location: southampton
User status: Offline
24th Apr 12 at 09:50   View User's Profile U2U Member Reply With Quote

The user is not visiting the page they are downloading it and then viewing it locally so speed should not be an issue.

We used to have a very painful system of producing some reports which involved XML documents with results (which needed rerunning often), copied to 3 different XLS spreadsheets which were then macroed into a Word document, which was then finally edited, then published as a PDF. Rebuilding the report was a nightmare.

We have streamlined this so all our data is in a MySql database. We can generate the report on the fly using a set of php scripts which produces the report to publish.

Looks like my solution will be to do all the image embedding in the php
ed
Member

Registered: 10th Sep 03
User status: Offline
24th Apr 12 at 09:54   View User's Profile U2U Member Reply With Quote

Ah, I see. Just as another option as a PDF might still be more appropriate - create some PHP and HTML template files and output them as PDF's using this:

http://code.google.com/p/dompdf/
Dom
Member

Registered: 13th Sep 03
User status: Offline
24th Apr 12 at 10:55   View User's Profile U2U Member Reply With Quote

Using HTML for this is a messy inefficient bodge of solution. You're better pulling data out of your DB and generating PDFs or Word Docx, free PHP libraries exist for both, if it's for reporting. Plus you also have use of compression when using PDFs which you won't get with using HTML.

If you're desperate to use HTML then i'd be creating a script to run through the images, opening them up and generating the necessary base64 encoding.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
My Side Project Steve General Chat 24 590
26th Jan 05 at 14:14
by Steve
 
Anyone know knows Dreamweaver K2 GTi Geek Day 3 169
21st Mar 06 at 15:34
by K2 HOY
 
Opinion on my website James Geek Day 28 1552
30th Mar 06 at 22:51
by Bart
 
Anyone know PHP? Bit of help needed... liamC Geek Day 38 1454
24th Nov 06 at 23:02
by MarkPW
 
Need to create HTML for this........ FINISHED PG3 dave17 Geek Day 72 2339
11th Jan 07 at 23:31
by drax
 

Corsa Sport » Message Board » Off Day » Geek Day » Saving HTML as XHTML 29 database queries in 0.0105941 seconds