How do I use the FPDF Library in Angular 5.0 - fpdf

I am using Angular 5.0 and the FPDF Library (www.fpdf.org) for creating PDF documents in PHP code.
I have used this library in JavaScript with no problems, however with Angular, which the marketing people say is a superset of JavaScript, the PHP code I create to format a PDF produces nothing.
I can run this PHP code directly from the browser, and it works perfectly, so there is nothing wrong with the PHP.
I have even tried calling the PDF formatter from another PHP (include 'test_pdf.php') and it does not work. It seems to know that it is being called from Angular, and will not allow the FPDF Library to do it's work.
How do I pass a parameter to, and call the PHP code which uses the FPDF Library?
Thanks for your assistance.

Related

How can I "drill down" into a website using Perl's WWW::Mechanize

I have used the WWW::Mechanize Perl module on a number of projects and it's helped me out a lot.
I am trying to use it on a different site and I can't "drill down" into the content of the site.
The site is https://customer.bookingbug.com/?client=hantsrecyclingcentres#/services
I have tried figure out what the URL would be to get content shown in the resulting HTML, such as bb.d570283b87c834518ba9.css, bb.d570283b87c834518ba9.js and version.js
I tried to copy the resulting HTML into this posting, but used all sorts of quote and code sample combinations and it wouldn't display properly.
Does anyone have any idea how I "navigate" this site using this Perl module please?
WWW::Mechanize is a web client with some HTML parsing capabilities. But as you clearly noticed, the information you want is not in the HTML document you requested. Either download the correct document (whatever that might be), or do what the browser does and execute the JavaScript. This would require a JavaScript engine. The simplest way to achieve that is to remote-control a web browser (e.g. using Selenium::Chrome).

How do I crawl a website written in JSP (Java Server Pages) using Perl Script?

I have here this website:https://www.connect2nse.com/iislNet/UserFolder.jsp
Firstly i tried using WWW::Mechanize, but it doesn't seem to work. WWW::Mechanize doesn't work with JSP written website. So I researched about how to download a file in a website written in JSP, but can't find a good one. Can anybody help me with this one? Thanks in advance.
As far as the client is concerned, JavaServer Pages is identical to PHP, Perl, or even static HTML files. The result is a page of HTML that can be rendered and displayed, and the source of the data isn't the reason for WWW::Mechanize failing to do what you want
Doesn't work is useless as a problem description, and the issue could be pretty much anything. However, if the HTML is associated with some JavaScript (which is executed on the client system after the page has been retrieved and not on the server) then it may be more or less handicapped because WWW::Mechanize doesn't support JavaScript. For that you will need to use WWW::Mechanize::Firefox or similar, which works by using a real instance of Firefox to render the HTML and execute any JavaScript

Converting HTML to pdf in GWT Client side

Is there a way to convert some html to PDF in GWT Client side
I have seen some libraries like iText , but they all seem to work on server side .
can i get the PDF without involving any server side work
is there any possibility
Thanks
I think you can use this JS Library to generate pdf on the client:
https://parall.ax/products/jspdf
or look in this SO question: Generating PDF files with Javascript

Running HTML5 with Database in Android WebView

I am developing an app with html5 pages locally stored in the assets folder. I have included a database with some php scripts, is it still possible to run in WebView?
for using database in webView you have two ways:
1) use localStorage that you should handle it by javaScript
2) use java database,for that you need javaScriptInterFace() that provide you a bridge between javaScript and java class. and create java database then put your data in it or read from it
see this link it will help you-(this link show you how use java database like browser localStorage)
No not at all you can not run a php in a webview it can understand only html ,CSS and JavaScript just like a browser.
Suggestion 1:
If you want to build a HTML page using your local database you could do that using java no need of php.
Just fetch the data from db then build HTML page by concatenating java strings with the data,HTML mark up,CSS and javascript then load the resulting HTML page in webview
If you want to access Java function from JavaScript you could use addjavascriptinterface of java.
The java function can be anything like a function that inserts or updates data into local dB or a function that returns a data from local db
It can also produce dynamic html content locally jus like a dynamic web language like php,classic asp etc..
Suggestion 2:
If you want to do it using php then you have to host it in the internet server along with db and load the page URL in webview

iPhone HTML Parsing using TouchXML and tidy

I'm trying to parse HTML using TouchXML. However, it seems that the data I want to parse (I do not control the source, it's downloaded from the internet) is partially malformed - I get various errors during the parse. Therefore, it seems that I should be using the inbuilt tidy support to fix the HTML but I cannot seem to find any documentation or information on how to enable it or link libtidy successfully into my project.
If anyone has any information on how to do this, it'd be much appreciated. Alternatively if there's another tool I could be using to do this - do tell me!
Actually, you can both link to the framework and include the headers, without needing to download the source.
Link to the existing framework libtidy.dylib
Add /usr/include/tidy to HEADER_SEARCH_PATHS
Turns out that although the framework can be linked in to an xcode project, the headers are missing. I have got around this by downloading the HTML Tidy Source (src and include directory) and added them in to compile as part of my xcode project.