         //       - inject pagination
         if let link = publication.link(withHref: path),
             link.typeLink == "application/xhtml+xml" || link.typeLink == "text/html",
-            publication.metadata.rendition.layout == .reflowable && link.properties.layout == nil
-                || link.properties.layout == "reflowable",
-            let baseUrl = publication.baseUrl?.deletingLastPathComponent()
-        {
-            decodedInputStream = injectHtml(in: decodedInputStream, for: baseUrl)
+            let baseUrl = publication.baseUrl?.deletingLastPathComponent() {
+            if publication.metadata.rendition.layout == .reflowable && link.properties.layout == nil
+                || link.properties.layout == "reflowable"
+            {
+                decodedInputStream = injectReflowableHtml(in: decodedInputStream, for: baseUrl) as! DataInputStream
+            } else {
+                decodedInputStream = injectFixedLayoutHtml(in: decodedInputStream, for: baseUrl) as! DataInputStream
+            }
         }
 
         return decodedInputStream

        // Inject additional content in the resource if test succeed.
        if let link = publication.link(withHref: path),
            link.typeLink == "application/xhtml+xml" || link.typeLink == "text/html",
            publication.metadata.rendition.layout == .reflowable && link.properties.layout == nil
                || link.properties.layout == "reflowable",
            let baseUrl = publication.baseUrl?.deletingLastPathComponent()
        {
            decodedDataStream = injectHtml(in: decodedDataStream, for: baseUrl) as! DataInputStream
        }

        return decodedDataStream.data
    }

    fileprivate func injectHtml(in stream: SeekableInputStream, for baseUrl: URL) -> SeekableInputStream {

        let bufferSize = Int(stream.length)
        var buffer = Array<UInt8>(repeating: 0, count: bufferSize)


        var includes = [String]()

        includes.append("<meta name=\"viewport\" content=\"width=device-width, height=device-height, initial-scale=1.0;\"/>\n")
        /// Readium CSS -- Pagination.
        // HTML5 patches.
        includes.append(getHtmlLink(forRessource: "\(baseUrl)styles/html5patch.css"))
