Rob_Quads
Member
Registered: 29th Mar 01
Location: southampton
User status: Offline
|
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
|
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
|
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
|
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
|
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
|
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
|
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.
|