tcpdf jQuery object conversion issue to pdf - tcpdf

I need to generate a PDF report and make that available as download on the screen.
I created an html to display the report and passing the html to TCPDF to convert the html to PDF.
There is a jQuery component in html which shows a graph. This graph is not converting into PDF.
If I display the html directly on browser the jQuery component runs and displays the visual graph but TCPDF is not able to display the graph in PDF.
Here is the jQuery component that I am using for displaying the graph: http://www.jqueryscript.net/loading/Minimalist-Graphical-Progress-Indicator-with-jQuery-Canvas-circleGraphic.html.
Please help.

It is pretty naive to expect all the scripts, styles and dynamically generated canvases to readily work in any environment which is not a so-called «grade A» web browser.
TCPDF has its graphic methods which you could use to draw vector images resembling your graphs.

Related

Can Orbeon generate an HTML document of a form instead of a PDF?

Orbeon provides a button to generate a PDF version of a form. It appears that it is generating an HTML document and then that is being converted to PDF. I am looking for a way to get that HTML document instead of the PDF. Is this possible?
This is currently not possible. It is correct that Orbeon Forms first generates HTML and then converts that to PDF (with the automatic PDF mode).

Different PDF output In IE Vs FF using TCPDF

In our webapplication we create a PDF based on some XHTML code. For some test purposed I've added some static XHTML in A PHP variable and put that into TCPDF which create as follow a PDF from it. The strange thing is that the PDF which are created in Firefox is different then the PDF I created in Internet Explorer. Same URL / Same code / Same content for the PDF.
I've writed the PDF to the filesystem for the tests and look the PDF's with Adobe reader.
How is this possible? TCPDF is browser independent I think.
Please try with this code, add it in the PHP code section. Also check the XHTML content works same in both IE and FF. Just view the content in browser before creating the PDF.
header('Content-type: application/pdf')

embed javascript to a jasper report pdf?

I want to embed a javascript function into a pdf file generated by jasper.
it comes to my mind because I want to make the pdf file auto open printing dialog.
after reading this question and tried this example I want to do the same.
but I use iReport designer to create my pdf templates and then export using struts actions, any idea how to embed javascript with ireport?
thanks
You can try to use the net.sf.jasperreports.export.pdf.javascript property.
The information about this property is here.

Display <svg> in iOS Browser using <html> without the use of the <embed> Tag

Is it possible to display <svg> content inside an <html> in an iOS browser without the use of the <embed> or <img> tags which require me to store the <svg> content in a separate file?
The embedding of <svg> content inside <html> seems to work on all other modern browsers (IE9, Chrome, even Safari on Window!).
I have found some references that suggest changing the content-type to 'text/xml' might work, but I am not able to change it as my code is running as part of a mobile server control in SharePoint 2010.
My page contains several <svg> areas, each of which displays a simple graph. The data for these graphs is stored in a serialized object which needs to be deserialized before the svg polylines can be drawn. Since the deserialization process is time-consuming I prefer to do it once and generate all graphs in a single pass, rather than generating resource references to individual svg files which can be referenced by an <embed> tag.
Edit: There are indications that inline <svg> is supported in iOS5.
If you need to embed the SVG directly in the document
Use XHTML (not just HTML), serve it with the correct mime type, and your SVG will work correctly in all major browsers, including on the iPhone and iPad.
This example file uses inline SVG in XHTML, and even uses JavaScript and CSS in the host document to manipulate the SVG:
http://phrogz.net/SVG/svg_in_xhtml5.xhtml
It works fine in iPhone/iPad.
If you need to reference an external file
Use the <img> tag to reference your SVG directly. This works on iOS.
For example, open this on your iPhone/iPad:
http://phrogz.net/SVG/svg-via-img.html
which references
http://phrogz.net/SVG/heart.svg
Note that there is a bug with WebKit related to rendering variable-sized SVGs inside fixed-size <img> tags. (It appears to draw the aspect ratio for the SVG from the aspect ratio of the containing window instead of the dimensions of the <img> element.) You can see the weirdness in Chrome or Safari if you resize your browser window with that test file.
You may need to use inline SVG inside an XHTML compound document. In this case, XML namespaces are used for both the HTML root element and the inline SVG element. See here for a relevant example:
http://www.croczilla.com/bits_and_pieces/svg/samples/dom1/dom1.xml
Other useful examples may be found here:
http://www.croczilla.com/bits_and_pieces/svg/samples
Have you tried using <object>? I haven't done this in a while but you can Google for that.

How to see XFA forms in i-Pad?

I would like to develop an interactive XFA form in LiveCycle Designer ES -2 which will support Windows as well as i-Pad. But the problem is when I open an XFA form it does not show the form rather it shows the form can not be shown(If the form has scripts within it).It only shows simple PDF documents in read only format.It also does not show the button in Acroforms.There is no interactivity related with the form.I would like to know is there any way to show the interactive PDf forms?
There is also another solution from SPZAP designed for Microsoft SharePoint and supporting XFA forms in PDFs and in some way in HTML5 compliant browsers. It has a form designer that runs in a browser (html5) and two kinds of runtime that are SharePoint integrated and are displaying PDF either in Adobe Acrobat Reader (probably Foxit in future) or converted as html5 structure (with some limitations in latter case). http://www.pdfsharepoint.com
LiveCycle Mobile ES4.0 will be able to render your forms. The look will be similar to HTML rendering.
http://www.adobe.com/products/livecycle/mobile/
The built-in pdf reader doesn't support dynamic PDF forms, Adobe doesn't have an iOS client and iPad doesn't support flash (natively).
Your only option is to render the form as HTML using LiveCycle Forms ES (server module).
You cannot render an interactive form in iPad as pdf. Reason being Apple doesn't allow any application (except web browser) to run any kind of scripts inside it (In this case Acrobat application, trying to run Javascript).
But you can render it as HTML which can be rendered in a browser and has some strip out functionality than the pdf version but its worth to try.

Resources