PHP AJAX PDF Reader just like book - php

Does anyone know how to build something like the functionality shown here: like sliding a book
I want to load PDF content, so that users can read all of my PDFs like a slideshow.
I'd like to use PHP, MySQL and JQuery, but I haven't found any JQuery plugin that functions like a PDF reader.

Don't think there is a solution in AJAX, jQuery or Javascript yet. You have to build it yourself or...
what you can do is convert each page in PHP to JPG (there are a lot of classes to do that), after that you can then load the pages in a jQuery Slideshow or load the images external from a flash file.

Related

How to implement an editable textarea component on a PDF generated by TCPDF library?

I am trying to create an editable HTML textarea component using TCPDF API library. I want to display a scrollable text box on the screen.
Can this be done?
Current TCPDF examples include these: https://tcpdf.org/examples/
I know PDFs can have editable components, but I am not sure how to create them with TCPDF, if it is at all possible.
TD;DR: how can I generate a page with a scrollable textarea using PHP + TCPDF?
Linked Answer using another library (mPDF):
Note that while How to create editable Pdf form in php may work, it does not make use of TCPDF library. My existing codebase relies heavily on TCPDF, I would like to explore the possibility of using TCPDF before I consider adding another library ...
i.e. I rather have an answer of "Not possible" than to use another library at this time.
It looks like the issue is two-fold.
First, you can use a typical form example, like here: https://tcpdf.org/examples/example_054/
However, you cannot see editable fields in a browser, at least you cannot in Mozilla Firefox 56.0.2 as the time of this writing. (https://support.mozilla.org/en-US/questions/1006115)
What you need to do is open the generated PDF in a different viewer that supports editable form fields, such as Adobe PDF reader/other.
Then you can fill out the textarea and if text size exceeds the area of the form element, it will have scroll bars added to the textarea.

how to create new image with frame on it?

im going to create something like this http://www.photofacefun.com/photoframes/, its creating a new image with frame on it, can i do that with php, jquery, or html? or do i have to use any jquery library? is there any jquery plugin like this? doesnt matter if its a paid or free.
how can i add a frame to an image with php and jquery?
And on the example above, are they using php or another language? java maybe. I really have no idea about this.
thanks..
Here is a demo of a responsive image grid using only HTML and CSS.
You can find the code here as well.
You can remove the titles and paragraphs if you like and can make them behave as links using the http://www.something.com"> attribute.
On the example they are using jquery.

Wordpress article and dynamic data/graphs, images to PDF

I'm using Wordpress to manage a newsletter with IssueM, also I need to be able to export the content of a group of articles to PDF (Keep in mind that I'm not a php hardcore developer).I'm using Advanced Custom Fields to generate some data and then creating graphs using NVD3 with javascript.
At this time, all the plugins I found to create PDF's did not work, they only "print" the title of the post(article in IssueM) and nothing else.
I need to be able to export the content, rendered graphs and tables with images, to PDF as they appear in the browser (styled via CSS in my page).
I found there is FPDF, and mPDF, also DOMPDF but they don't specify if they can render the javascript output (which are my NVD3 rendered graphs) to PDF.
Is there any tool that can acomplish this? or,
Do I have to do this by hand? If that's the case, can you tell me an approach?
Have you had a look at:
https://wordpress.org/plugins/printfriendly/
You should be able to add/remove/customize elements that print out:
http://support.printfriendly.com/publisher/developer-questions/include-exclude-content/
It should render javascript because it is using javascript (make sure you enable javascript use in the plugin):
http://support.printfriendly.com/publisher/wordpress/javascript-option/
Hope that helps!

What is the easiest method to allow someone to download a PDF copy of a HTML page?

I have a HTML page that contains a table with a list of a customers orders (pulled from a database via PHP).
I want to have a button on the page that will allow the users to download a PDF copy excluding the navigation bar etc.
The examples that I've seen and tested online initially load the page in PDF format but I don't want this. I want it to load as it currently is but also have a button that when pressed downloads a PDF copy (i.e. not display it in the browser).
wkhtmltopdf will do the trick:
http://wkhtmltopdf.org/
It should allow you a lot of customization options.
But if you want to generate it dynamically then you have to use some library for pdf . There are many library like tcpdf, dompdf etc.
Dom pdf example
From experience I would recommend Phantom JS - see an example
I found Phantom JS offers better HTML/CSS support when compared to wkhtmltopdf.
Bear in mind, you will struggle to get support for things like CSS3 columns in Phantom and Wkhtmltopdf.
Workflow:
Land on initial page (later to be converted to PDF).
Display button - 'download as PDF'
Listen for the click event on this button and call a custom callback
function once the event is fired.
The callback function executes an Ajax call sending the full page
HTML as part of the server request.
On server side, fire up Phantom JS or Wkhtmltopdf to generate PDF. Save
PDF on server.
Generate URL for saved PDF and display/load client side.
PS; I'm not sure if Phantom JS will generate a PDF from a string or whether it expects a valid url. I know Wkhtmltopdf can generate a PDF from a string.
Hope this helps
Since you ask for the easiest way.. just print the HTML client side. This button invokes printing the web page client side:
<input type="button"
onClick="window.print()"
value="Print This Page"/>
Then the user would have to select a PDF printer driver. Chrome has this built in.
Here you can read how to exclude parts of the HTML (such as the print button itself) from being printed:
How do I hide an element when printing a web page?

PHP page to PDF with object oriented websites

I'm trying to get my shopping cart items to a pdf to create an invoice
I have url which shows the invoice in html/css like this:
index.php?module=checkout&view=topdf
If I want to get the content of that page to use in mPDF or other pdf libraries using file_get_contents or cURL it doesn't give any content because the url is not an actual file on the server
How can I fix this? I work with templates and don't know how can I export the current php page to a html page
I used TCPDF for something similar. Getting the formatting right is a bit of a pain but once you've got that it's a really good bit of work.
http://www.tcpdf.org/examples.php

Categories