Tweet
Following a brief exchange of thoughts with Carlo (one of the web thought readers), I have decided to publish a list of resources aimed to the creation of Barcodes. Originally, Carlo wanted to insert a barcode in a PDF document using FPDF, however the subroutine he found generates a HTML table that is almost impossible to embed in a PDF with FPDF.
Other solution are possible. The point is to create a Barcode image, save it on the server, and then insert it into the PDF. I haven't explored the above idea, but I think that the following resources might help some to accomplish the task.
Here's the list:
Barcode Coder (jQuery)
jQuery-Barcode (jQuery)
Pure ASP Barcode Generator (pure ASP)
ASP Barcode Script (pure ASP - Thanks to Carlo)
Barcode Generator (JavaScript)
Creating a Code 39 Barcode using HTML, CSS and Javascript (JavaScript)
Javascript Code128 Barcode (JavaScript)
Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts
Monday, 16 April 2012
Friday, 8 July 2011
ASP: use FPDF to create a PDF with a dynamic table
Tweet
Following my two previous articles about FPDF (Create PDF files with FPDF and FPDF MultiCell with multiple lines and positioning), today I would like to share a way to create a table dynamically, getting the items from a database, and displaying those items one after the other.
As usual, we have to make some assumptions. First of all we have a database from which we will get the records for the table. As an example, we can imagine our table is something like:
Our goal is to create the PDF with the above table. We will create the table dynamically, and the table will have two columns: one for the fruits and one with the image of the related fruit.
If you are interested in the following explanation, but you haven't read the previous articles about FPDF, I suggest you read them before continuing, because here I assume you already know how to create a basic PDF file using FPDF.
Following my two previous articles about FPDF (Create PDF files with FPDF and FPDF MultiCell with multiple lines and positioning), today I would like to share a way to create a table dynamically, getting the items from a database, and displaying those items one after the other.
As usual, we have to make some assumptions. First of all we have a database from which we will get the records for the table. As an example, we can imagine our table is something like:
FRUIT | IMAGE_URL |
orange | /images/orange.jpg |
apple | /images/apple.jpg |
pear | /images/pear.jpg |
Our goal is to create the PDF with the above table. We will create the table dynamically, and the table will have two columns: one for the fruits and one with the image of the related fruit.
If you are interested in the following explanation, but you haven't read the previous articles about FPDF, I suggest you read them before continuing, because here I assume you already know how to create a basic PDF file using FPDF.
Wednesday, 25 May 2011
ASP: FPDF MultiCell with multiple lines and positioning
Tweet
As described in another post (ASP: Create PDF with FPDF), FPDF allows to create PDF files dynamically. I described how to create text boxes using MultiCell. I assume you already know how to do it, and I believe you might have encountered a little problem with the cells positioning. Let me explain it.
As described in another post (ASP: Create PDF with FPDF), FPDF allows to create PDF files dynamically. I described how to create text boxes using MultiCell. I assume you already know how to do it, and I believe you might have encountered a little problem with the cells positioning. Let me explain it.
The positioning
When we position a multicell, we use a code like:
pdf.SetXY 8,156
pdf.setfillcolor 197,198,200
pdf.MultiCell 40,4,"Hello!",0,0,1
The above snippet is taken from the aforementioned article. Basically we set the X and Y position of the multicell, the background colour and then we place the multicell using different parameters (width, height, text, border etc.)Monday, 11 October 2010
ASP: Create pdf files with FPDF
Tweet
One interesting thing you can do in a web site or application is to present reports directly in pdf format. If you have a database from which you pull data, you can manipulate the information and create a pdf file on the fly. FPDF is a PHP class created by Olivier PLATHEY, but a wise guy named Lorenzo Abbati translated it for asp. The class is completely free for commercial and non commercial use, and has almost everything you need to build up your pdf document. The problem is that Lorenzo has his web page and all the related documentation in Italian. You can always refer to the original PHP version of the class in order to understand in depth how it works. Here I will only scratch the surface and explain the basics.
One interesting thing you can do in a web site or application is to present reports directly in pdf format. If you have a database from which you pull data, you can manipulate the information and create a pdf file on the fly. FPDF is a PHP class created by Olivier PLATHEY, but a wise guy named Lorenzo Abbati translated it for asp. The class is completely free for commercial and non commercial use, and has almost everything you need to build up your pdf document. The problem is that Lorenzo has his web page and all the related documentation in Italian. You can always refer to the original PHP version of the class in order to understand in depth how it works. Here I will only scratch the surface and explain the basics.
Subscribe to:
Posts (Atom)