I wanna edit epub file content in PHP to erase some text from begging of the ebook. I have tried some libraries with no success.
https://github.com/Grandt/PHPePub
https://github.com/Vaporbook/BookGluttonEpub
https://sourceforge.net/projects/oplsepublibrary
They can edit authors, isbn, description, creator, cover, etc., or create new epub file, or open epub file, but I haven't found some solution for editing content.
Do you know some easy way how to do it?
Now I know, that you can just unzip epub as simple zip file and then edit all html and css files :)
After you have done changes, just zip the files back.
Related
I need to find a way to upload a pdf file to my terms & services page in opencart2. I've looked for an extention, but the suitable extentsion are for opencart 1.5.x.
Is there a way to upload a pdf file and make it downloadable on the information page?
The easiest way would be to upload the file using FTP to a location within your website (e.g. the downloads subdirectory), then put a link to it on the information page using the information page editor. (e.g. http://www.tuinenmetgevoel.nl/downloads/myfile.pdf)
I was searching for this but i can't find anything like this.I'm new to PHP, I want to have a backup of all my pictures in specific directory.
I want when i click on link it collect all the images in that directory and compress them into a zip file, then it give me a download link for them.
I saw an answer before for how to (download multiple files as zip in PHP) but i don't know how to get all the images full names in this directory and merge them with the commands for zipping
I wish that's possible.
I have some PDF files, on pdf version 1.6.
i have been trying the following libraries to edit the metadata of these pdf files:
Zend_Pdf class: which worked nicely for pdf version 1.5 or less. but had an error on parsing pdf of version 1.6
pdflib: not sure how i can edit an existing pdf file.
tcpdf: same problem that i couldn't find the functions for editing the existing pdf
someone also suggested just edit the pdf file by adding the following(for an example, title) to the end of the pdf file:
/Title (Title Text)
i would still wish to be able to do it using pdflib or some free source php libraries to achieve this.
PDFlib cannot edit an existing file, but you can copy the content of an existing file to a new file and read the metadata from the import document, change it and then write it to the new document.
http://www.pdflib.com/pdflib-cookbook/document-interchange/import-xmp-from-pdf/php-import-xmp-from-pdf/
is an example showing parts of this approach.
I have 16631 files hosted in a webserver, 2719 of them are text files that contains a list of specific files located on the server.
Using PHP, is possible to create a ZIP for each text file?
could be the text file name as ZIP file name?
I want to keep the same directory structure in the ZIP file.
Thanks in advance.
Taking the suggestion from Jeff Hines, you could use the ZipArchive class to create the zip.
In Pseudo code
Get List of Text Files in your folder
Read Text file and get list of files to add to zip
Using ZipArchive add each listed file to your new zip file.
Write flag to specify you've done this file.
You might need to run it on 10 files at a time since it may time out.
I want to open an .epub document with PHP, to modify it (for example to add some text on the first page and last page) and to save it back to .epub I found some classes for saving a text into epub file, but I can't find anything about opening an epub in PHP.
epub files are just HTML+CSS files inside a ZIP archive (called the Open Container Format (OCF)) files with a different file extension :) So you can use PHP's ZipArchive class to work on the file.
There are libraries that support EPUB files. BookGlutton is one.