diff --git a/index.html b/index.html index 177cfe9..dd2364d 100644 --- a/index.html +++ b/index.html @@ -42,8 +42,7 @@ @@ -138,13 +105,13 @@
+ src="assets/img/404.png">
+ src="assets/img/404.png">
@@ -188,7 +155,7 @@ document.documentElement.style.setProperty('--iframe-height', '800px'); } - else if ((editionchoisie == 'didier') || (editionchoisie == 'hatier')) { + else if ((editionchoisie == 'didier-hatier')) { console.log("Didier ou Hatier"); document.getElementById("editionesthcoisieest").innerHTML = ""; diviframe.style.display = ''; @@ -264,16 +231,28 @@ changerURL(code, editionchoisie); } + function changerEdition(valeur) { + var selectElement = document.getElementById('edition-select'); + for (var i = 0; i < selectElement.options.length; i++) { + if (selectElement.options[i].value === valeur) { + selectElement.selectedIndex = i; + break; + } + } + } + function changerURL(code, editionchoisie) { var server = document.querySelector('select[name="server"]').value; console.log(server); if (editionchoisie == 'hachette') { + // changerEdition('hachette'); var newUrl1 = "https://exobank.hachette-livre.fr/contents/final/" + code + "-fxl/OEBPS/Page_1.html?interface=postMessage"; var newUrl2 = "https://exobank.hachette-livre.fr/contents/final/" + code + "-fxl/OEBPS/Page_2.html?interface=postMessage"; iframe1.src = newUrl1; iframe2.src = newUrl2; } - else if ((editionchoisie == 'didier') || (editionchoisie == 'hatier')) { + else if ((editionchoisie == 'didier-hatier')) { + // changerEdition('didier-hatier'); var newUrl1 = "https://exobank.hachette-livre.fr/contents/final/" + code + "-fxl/OEBPS/page1.xhtml?interface=postMessage"; var newUrl2 = "https://exobank.hachette-livre.fr/contents/final/" + code + "-fxl/OEBPS/page2.xhtml?interface=postMessage"; iframe1.src = newUrl1; @@ -281,6 +260,7 @@ } // https://nohamr.github.io/Manuelcontent/Belin/1ere/geographie-premiere/page1.jpg else if (editionchoisie == 'belin') { + // changerEdition('belin'); var newUrl1 = "https://nohamr.github.io/Manuelcontent/Belin/" + code + "/page1.jpg"; var newUrl2 = "https://nohamr.github.io/Manuelcontent/Belin/" + code + "/page2.jpg"; img1.src = newUrl1; @@ -288,6 +268,7 @@ } // https://assets.lls.fr/books/48453088/print/14.jpg else if (editionchoisie == 'LLS') { + // changerEdition('LLS'); var newUrl1 = "https://assets.lls.fr/books/" + code + "/print/1.jpg"; var newUrl2 = "https://assets.lls.fr/books/" + code + "/print/2.jpg"; img1.src = newUrl1; @@ -295,6 +276,7 @@ } // https://manuel.sesamath.net/imgs_produites/pages/ms6_2013/ms6_2013_page0.gif else if (editionchoisie == 'sesa') { + // changerEdition('sesa'); var newUrl1 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Sesamath/" + code + "/page0.gif"; var newUrl2 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Sesamath/" + code + "/page1.gif"; img1.src = newUrl1; @@ -305,6 +287,7 @@ // https://storage.libmanuels.fr/Magnard/specimen/9782210113183/9/OEBPS/page005.xhtml // https://storage.libmanuels.fr/Magnard/specimen/9782210118201/1/OEBPS/page005.xhtml else if (editionchoisie == 'magnard') { + // changerEdition('magnard'); var newUrl1 = "https://storage.libmanuels.fr/Magnard/specimen/" + code + '/' + server + "/OEBPS/page002.xhtml?interface=postMessage"; var newUrl2 = "https://storage.libmanuels.fr/Magnard/specimen/" + code + '/' + server + "/OEBPS/page003.xhtml?interface=postMessage"; iframe1.src = newUrl1; @@ -312,12 +295,14 @@ } // https://storage.libmanuels.fr/Delagrave/specimen/9782206103983/8/OEBPS/page005.xhtml else if (editionchoisie == 'delagrave') { + // changerEdition('delagrave'); var newUrl1 = "https://storage.libmanuels.fr/Delagrave/specimen/" + code + '/' + server + "/OEBPS/page002.xhtml?interface=postMessage"; var newUrl2 = "https://storage.libmanuels.fr/Delagrave/specimen/" + code + '/' + server + "/OEBPS/page003.xhtml?interface=postMessage"; iframe1.src = newUrl1; iframe2.src = newUrl2; } else if (editionchoisie == 'nathan') { + // changerEdition('nathan'); var newUrl1 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Nathan/" + code + "/page1.jpg"; var newUrl2 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Nathan/" + code + "/page2.jpg"; img1.src = newUrl1; @@ -359,7 +344,7 @@ nbpage.value = page1; } // page1.jpg - else if ((editionchoisie == 'didier') || (editionchoisie == 'hatier')) { + else if ((editionchoisie == 'didier-hatier')) { console.log("hatier ou didier ou belin"); page1 += delta; page2 += delta; @@ -494,7 +479,7 @@ @@ -594,5 +579,8 @@ capture(); --> - + + + \ No newline at end of file diff --git a/py/magnard/test.py b/py/magnard/test.py new file mode 100644 index 0000000..dc8eed1 --- /dev/null +++ b/py/magnard/test.py @@ -0,0 +1,39 @@ +import pdfkit + +# Configure PDF options +options = { + 'page-size': 'A4', + 'margin-top': '0mm', + 'margin-right': '0mm', + 'margin-bottom': '0mm', + 'margin-left': '0mm', +} + +# Get the path to the wkhtmltopdf executable installed via Homebrew +wkhtmltopdf_path = "/usr/local/bin/wkhtmltopdf" # Replace with the actual path + +# Create a directory to save the PDF files +import os +output_directory = "output_pdfs" +os.makedirs(output_directory, exist_ok=True) + +# Define the base URL and filename format +base_url = "https://storage.libmanuels.fr/Magnard/specimen/9782210107175/1/OEBPS/page" +filename_format = f"{output_directory}/page{{:03d}}.pdf" + +# Iterate through pages 1 to 263 and generate PDFs +for page_number in range(1, 264): # Pages from 001 to 263 + # Construct the full URL for the current page + url = f"{base_url}{page_number:03d}.xhtml?interface=postMessage" + + # Provide the path to the wkhtmltopdf executable + config = pdfkit.configuration(wkhtmltopdf=wkhtmltopdf_path) + + # Generate the PDF for the current page + try: + pdfkit.from_url(url, filename_format.format(page_number), configuration=config, options=options) + except Exception as e: + print(e) + print(url) + +print("PDFs created successfully.") diff --git a/py/magnard/test2.py b/py/magnard/test2.py new file mode 100644 index 0000000..f488113 --- /dev/null +++ b/py/magnard/test2.py @@ -0,0 +1,2 @@ +from weasyprint import HTML +HTML('https://storage.libmanuels.fr/Magnard/specimen/9782210107175/1/OEBPS/page003.xhtml?interface=postMessage').write_pdf('output.pdf') \ No newline at end of file