• 3000 page formatted microsoft word document that I am turning into a wordpress page.
    Pasting from word option, not an option, because I cannot go through and re-format 3000 pages, and anyway I am running into a “request entity too large”.
    Saving MS word as html preserves formatting, but i would like to insert it into my wordpress theme.
    can a static WP page call an external html?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 3000 pages is like a collection of e-books. Who will wait for it to download as a single HTML page? It is not usable for the reader. I would make each chapter a reasonably sized PDF, and write a table of contents in WordPress with links to the PDF files.

    Agreed, that is a massive file, there has to be a better way to do it.

    Moderator cubecolour

    (@numeeja)

    I would approach this by creating a simple shortcode plugin using a php include to pull in the html.

    This quick n dirty plugin could probably be improved and assumes that you only have a single html file you want to include. It should be easy to tweak to allow several different books.

    Create a new folder with an appropriate name within your wp-content/plugins directory

    Lat time I used Word it was only able to output pretty bad & bloaty html by default, so you might need to do some clean up. I believe Google doc can take an uploaded Word doc & export cleaner html than Word itself can, but I’ve not tried this. If this doesn’t work, you may be able to run a few ‘search & replace all’ operations in a text editor.

    Once the book’s html file in your favourite text editor and cleaned up, a few other things need to be changed at the beginning & end.

    Delete the opening & closing <html> & <body> tags & also delete the head section from the file. What you want to be left with is a file containing everything that was inside the ‘<body>’ & ‘</body>’ tags after cleaning the html up.

    Name the html file appropriately (all lower case and hyphens instead of spaces is good) and upload it into the new directory you created.

    Create a new file in the folder you created for the plugin function. Change the names etc in my example (unless you actually are including the same Sherlock Holmes story I am using.)

    <?php
    /*
    Plugin Name: Sign of Four
    Plugin URI: http://cubecolour.co.uk
    Description: Include a book in a WP page using a shortcode
    Author: cubecolour
    Version: 0.1.0
    Author URI: http://cubecolour.co.uk/wp/
    */
    
    function cc_signoffour( $atts, $content = null ) {
    
    	$plugin_dir_path = dirname(__FILE__);
    
    	return sanitize_html_class(include_once($plugin_dir_path . '/the-sign-of-the-four.html'));
    
    }
    
    add_shortcode('signoffour', 'cc_signoffour');

    My example enables me to include the whole book within a WordPress page using the [signoffour] shortcode which is defined on the last line.

    Thread Starter nkatz22

    (@nkatz22)

    Thank you for the suggestions. So far I have come up with the following solutions:

    As cubecolor suggested I exported the entire page into html and used the Advance iFrame plugin to insert the html into a page, here. This solution is quite elegant and a pretty fast load, but it lacks a key element that the client requests which is the capacity to print any specified page and maintain its pagination (in the way that you would do from a pdf)

    As Rod Whiteley suggested, I converted the document into six separate pdf’s split by year and embedded them on separate pages using the Embed pdf plugin, here. This solution works well for reducing the magnitude of the document, but lacks another key element that the client requests which is the capacity to search for key words within the document (without first downloading the pdf).

    I’m leaving this post open for a little bit longer in case there are any other suggestions.
    Thanks!

    Moderator cubecolour

    (@numeeja)

    The solution I created is totally different to using an iFrame. If you try to create the plugin I outlined for you, you will see that.

    You should have mentioned the requirement to search the document in the browser. This should work with my solution using the default browser search function called up with the CTRL-F key combination.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘3000 page word document to wordpress page’ is closed to new replies.