Tutorial by Examples

In this example, we'll create the following table using iText 5: We need the PdfPTable and PdfPCell class to achieve this: public void createPdf(String dest) throws IOException, DocumentException { Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream...
In this example, we'll create the following table using iText 7: We'll need the Table and Cell class to achieve this: public void createPdf(String dest) throws IOException { PdfDocument pdf = new PdfDocument(new PdfWriter(dest)); try (Document document = new Document(pdf)) { T...
Requirements: PHP 5.6.0 or greater mbstring PHP extension (default works in WAMP/XAMPP, if not then enable it) intl PHP extension (Available in WAMP/XAMPP, you have to enable it from php.ini) CakePHP will run on a variety of web servers such as nginx, LightHTTPD, or Microsoft IIS. Befor...
Suppose that we have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: When using iText 5, we'd use the following code: public void createPdf(String dest) throws DocumentException, IOException { Document document = new Document(); PdfWriter....
Suppose that you have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: When using iText 7, we'd need the following code: public void createPdf(String dest) throws IOException { PdfDocument pdf = new PdfDocument(new PdfWriter(dest)); Document...
There are two main platforms in VR, one is mobile platform, like Google Cardboard, Samsung GearVR, the other is PC platform, like HTC Vive, Oculus, PS VR... Unity officially supports the Oculus Rift, Google Carboard, Steam VR, Playstation VR, Gear VR, and the Microsoft Hololens. Most platforms hav...
Suppose that we have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: When using iText 5, you'd need code like this: public void createPdf(String dest) throws DocumentException, IOException { Document document = new Document(); PdfWriter wr...
Suppose that you have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: When using iText 7, you'd need code like this: public void createPdf(String dest) throws IOException { PdfDocument pdf = new PdfDocument(new PdfWriter(dest)); Document do...
Detailed instructions on getting artificial-intelligence set up or installed.
Suppose that we have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: Note the blue border that is added to the titles, and the page number at the bottom of each page. In iText 5, these elements are added using page events: class MyPageEvents extends ...
Suppose that you have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: Note the page numbers at the bottom of each page. These are added using an IEventHandler implementation: protected class Footer implements IEventHandler { @Override pub...
Suppose that you have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: Note that this is very similar to what we had before, but the border of the titles now has rounded corners. We created a custom ParagraphRenderer to achieve this, and we created a T...
Executable JAR files are the simplest way to assemble Java code into a single file that can be executed. *(Editorial Note: Creation of JAR files should be covered by a separate Topic.) * Assuming that you have an executable JAR file with pathname <jar-path>, you should be able to run it as f...
Suppose that we want to create a simple Hello World document: In iText 5, this would be done like this: public void createPdf(String dest) throws DocumentException, IOException { Document document = new Document(); PdfWriter.getInstance( document, new FileOutputStream(des...
Suppose that we wanted to create a simple Hello World document: In iText 7, we could do that like this: public void createPdf(String dest) throws IOException { PdfDocument pdf = new PdfDocument(new PdfWriter(dest)); Document document = new Document(pdf); document.add(new Paragraph...
To Initialize a session, you can simply load it in your controller, this us usually placed inside the controller constructs, but it also can be autoloaded into the array found inside application/config/autoload.php: $this->load->library('session');
A session is simply an array consisting of the following user information: The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes) The user's IP Address The user's User Agent ...
This example illustrates the AES 256 symmetric cipher in CBC mode. An initialization vector is needed, so we generate one using an openssl function. The variable $strong is used to determine whether the IV generated was cryptographically strong. Encryption $method = "aes-256-cbc"; // cip...
In the .bashrc or .bash_profile, adding: export MYSQL_PS1="\u@\h [\d]>" make the MySQL client PROMPT show current user@host [database].
Objective-C NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id item, NSDictionary *bindings) { return [item isKindOfClass:[UILabel class]]; }]; Swift let predicate = NSPredicate { (item, bindings) -> Bool...

Page 804 of 1336