TAILIEUCHUNG - Phát triển web với PHP và MySQL - p 81

Generating Personalized Documents in Portable Document Format (PDF) CHAPTER 30 775 We will look at some of the parts of this script that are different from the previous examples. Visitors need to get their own details on a certificate, so we will create the document in memory rather than in a file. If we wrote it to a file, we would need to worry about mechanisms to create unique filenames, stop people from snooping into others’ certificates, and determine a way to delete older certificate files to free up hard drive space on our server. In order to create a document in. | Generating Personalized Documents in Portable Document Format PDF 775 Chapter 30 We will look at some of the parts of this script that are different from the previous examples. Visitors need to get their own details on a certificate so we will create the document in memory rather than in a file. If we wrote it to a file we would need to worry about mechanisms to create unique filenames stop people from snooping into others certificates and determine a way to delete older certificate files to free up hard drive space on our server. In order to create a document in memory we call pdf_open without parameters as follows pdf pdf_open Our simplified border will consist of three stripes a fat border and two thin borders one inside the main border and one outside. We will draw all of these as rectangles. To position the borders in such a way that we can easily alter the page size or the appearance of the borders we will base all the border positions on the variables that we already have width and height and a few new ones inset border and inner. We will use inset to specify how many points wide the border at the edge of the page is border to specify the thickness of the main border and inner to specify how wide the gap between the main border and the thin borders will be. If you have drawn with another graphics API drawing with PDFlib will present few surprises. If you haven t read Chapter 19 Generating Images you might find it helpful to do so as drawing images with the gd library is quite similar to drawing them with PDFlib. The thin borders are easy. To create a rectangle we use pdf_rect which requires as parameters the PDF document identifier the x and y coordinate of the rectangle s lower left corner and the width and height of the rectangle. Because we want our layout to be flexible we calculate these from the variables we have set. pdf_rect pdf inset- inner inset- inner width-2 inset- inner height-2 inset- inner The call to pdf_rect sets up a path in the shape of a

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.