Pslib Manual. 2 PSlib Pslib is a library for making “postscript (ps)” file. Postscript is a language for supporting the high-quality printer. Postscript.

Slides:



Advertisements
Similar presentations
Week 7: Input and Output 1.  Now we are going to talk a little bit about output  You have a lot of experience with System.out.println() and System.out.print()
Advertisements

Templated Functions. Overloading vs Templating  Overloaded functions allow multiple functions with the same name.
1 Abstract Data Types Chapter 1. 2 Objectives You will be able to: 1. Say what an abstract data type is. 2. Implement a simple abstract data type in C++
Lecture # 11 JavaScript Graphics. Scalable Vector Graphics (SVG) Scalable Vector Graphics (SVG), as the name implies, are - scalable (without pixelation):
The Flexible Learning Centre Oasis has a selection of tools that are easily accessible to Students. Our Black and white photocopier can only be operated.
GUIs Part 4 CS221 – 4/17/09. Professional Assignments Assignment #2 – Download and install Visual Studio 2008 Professional Trial Software –
Java Applets A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
C++ Graphics Primitives April 15th. void clearscreen(int c) –clear the screen to background color c –If c = 1 screen black.
Higher-level PHP constructs for manipulating image files.
PDF and the Palm Steve Builta. Have you seen the commercial?
Digimap Carto is an advanced version of classic but with many more options. You need to return to the Digimap home page and this time select the “Digimap.
Portable Document Format PDF. What is PDF? Universal file format developed by Adobe Systems Incorporates fine detail and quality of print publications.
Chapter 5 Using Business Information Sets
SP Attach for Outlook and SharePoint A better way to send files SP Attach works with Outlook 2007 and above and SharePoint 2010, 2013.
Portable Document Format PDF. What is PDF? Universal file format developed by Adobe Systems Incorporates fine detail and quality of print publications.
Digital Imaging and Remote Sensing Laboratory R.I.TR.I.TR.I.TR.I.T R.I.TR.I.TR.I.TR.I.T Writing Large Documents with LaTeX and WinEdt Emmett Ientilucci.
Create Professional-looking Content Easy to Use Interface Share Documents.
1 CSC 221: Computer Programming I Fall 2004 Objects and classes: a first pass  software objects, classes, object-oriented design  BlueJ IDE, compilation.
Statistical graphics for publication – easy ways to meet requirements for high resolution Jim Flewelling Growth Model Users Group February 11, 2008.
XP Practical PC, 3e Chapter 10 1 Writing and Printing Documents.
Lesson 3 Formatting a Presentation for Printing
Introduction to Programming with Java. Overview What are the tools we are using – What is Java? This is the language that you use to write your program.
Teaching with a just simple WINK. Wink is a Tutorial and Presentation creation software. Using Wink you can capture screenshots, add explanations boxes,
COMMON APPLICATION FUNCTIONS Presentation. Bullets  Symbols used to organize data into a list.  This  Is  An  Example  Of  A  Bullet  List.
Java Classes Using Java Classes Introduction to UML.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Object Oriented Programming … and other things you need to program in java.
Introduction to Computation and Problem Solving Class 9: Static Methods and Data Members Prof. Steven R. Lerman and Dr. V. Judson Harward.
1 / 9 Printing the Return Within TaxWise Online © 2006, Universal Tax Systems, Inc. All Rights Reserved. Printing the Return Within TaxWise Online Objectives.
Esri UC 2014 | Demo Theater | Troubleshooting Printing and Exporting from ArcMap Michael Grossman.
Login Instructions 1.Windows Login –User name=Student ID –Password (case sensitive) = Upper case letter Lower case letter Five numerals One symbol (use.
Digital Imaging and Remote Sensing Laboratory R.I.TR.I.TR.I.TR.I.T R.I.TR.I.TR.I.TR.I.T Creating Documents with LaTeX and WinEdt Emmett Ientilucci Digital.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Agenda Object Oriented Programming Reading: Chapter 14.
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
PLACING AND LINKING GRAPHICS
The Report Generator Viewing Student Outcomes. Install the Report Generator In a browser, go to Click.
CSC 1010 Programming for All Lecture 7 Input, Output & Graphics.
How to Use the Tools in Adobe InDesign CS3 for Yearbook Designing Layouts From Paper to Computer Layout.
Computer Information Technology – Section 5-4.  Objectives:  The students will 1. Understand the options on the Printer's Document Properties dialog.
IS 1014 Introduction to Computer Graphics -- Paul Munro A Postscript Tutorial Book available at: cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Ⅰ. PS Driver ML-4050N Series PostScript, Driver ML-4050N Series PostScript, Driver.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
JRN 302: Introduction to Graphics and Visual Communication -Intro. to InDesign Thursday,
1 Introduction to PostScript Sep. 21 Dae-Eun Hyun 3D MAP Lab.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
UML2-1 UML Exercise A "draw" utility program lets users draw several geometric objects on a diagram. A geometric object may be a Circle, Rectangle, Square.
CS 115 Lecture 6 Graphics Taken from notes by Dr. Neil Moore.
Adobe Illustrator CS5 - Illustrated Unit A:Getting Started with Adobe Illustrator CS5.
Microsoft Word Tutorial Albert Kalim. Topics You Should Know About Start MS Word Start MS Word Open a document Open a document Enter text Enter text Change.
Long Term Preservation of Digital Data Raymond A. Lorie JCDL ‘01 June 24-28, 2001.
Better Printing Practices
Area between Polar Curves
201 exam demystified Anna Gabali.
the following benefits: documents contained within a PDF Package
Ecology Mini Book Biology
Converting a Definite Integral to a limit of a Riemann Sum and converting a limit of a Riemann Sum to a Definite Integral This template can be used as.
Graphics Part I Taken from notes by Dr. Neil Moore
Graphics Part I Taken from notes by Dr. Neil Moore
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
Page description language from Adobe
صندوق ضمانت سرمایه گذاری صنایع کوچک
Lecture 2 - Building a Monogame Windows Project
Graphics Part I Taken from notes by Dr. Neil Moore
This file was saved as a powerpoint to give you a wider range in typing letters for each child’s name. File was saved having the letter.
Sec What is the Connection
Presentation transcript:

Pslib Manual

2 PSlib Pslib is a library for making “postscript (ps)” file. Postscript is a language for supporting the high-quality printer. Postscript language is developed by Adobe Inc.

3 Postscript Language Postscript language is widely used in many environment to support the printer or for making high-quality documents. The syntax of the postscript language is very simple and you can find many on-line tutorial about it. You don’t have to learn the postscript language grammar to use the Pslib, but, if you are interested in the syntax and more about the postscript, you can refer to the following links: – ipt.htmlhttp:// ipt.html – – – orial/ orial/ –postscript language cookbook pdf ( I think this is illegal because the book is a commercial product, but, anyway, if you want…):

4 Viewing Postscript File For viewing or printing a postscript file, you should install the following products: –Ghostscript –GSview –The above two software products can be freely downloaded from: –Note that the latetest version of the Ghostscript is 8.11 and that of GSview is 4.4 (Sep. 23, 2003). After the installations, you can test your “Gsview” by double-clicking “demo1/test.ps” file. If you have any problem to install the above two softwares, please let me know

5 DEMO1 Demo1 for Pslib is a “console” program. You don’t have to add any extra include directories or link any extra libraries. Start the demo1 project by clicking Pslib.dsw file.

6 Source Files Demo1 project consists of one header file (pslib.h) and two cpp files (demo.cpp and pslib.cpp). pslib.h and pslib.cpp –library source –You don’t have to change anything in these two files. demo.cpp –explaining how to use the pslib functions.

7 demo.cpp - 1 #include #include "pslib.h" int main() { cPSLib myps("test.ps"); You should include “pslib.h” The cPSLib instance is made by using a constructor which is called with a “ps file name” parameter. Now, your further output in the program will be written into the ps file “test.ps”.

8 demo.cpp - 2 float minx, miny, maxx, maxy; minx = f; maxx = 400.0f; miny = f; maxy = 700.0f; // fit the regions to A4 myps.FitA4(minx, miny, maxx, maxy); At first, we define the boundary of the drawings. We can make the boundary using PSlib::FitA4(…) function. Parameters: minx, miny, maxx, maxy Then, the drawing area is scaled to the given boundary.

9 demo.cpp - 3 Why A4Fit? –Sometimes, you want to draw some objects (lines, circles, …) having very general coordinates. –The default size of A4 paper for the postscript is 595 x 842. –That is, the default x coordinate range is [0..595], and y coordinate range is [0..842]. –If you want to draw some point set in [ ] x [ ], then you can fit the drawing area into the A4 paper using the function call: myps.FitA4(-300, 300, 900, 1200); –Note that this “FitA4” call should be made BEFORE ANY OTHER DRAWINGS in the ps file.

10 demo.cpp - 4 DrawPolygon(xarray, yarray, num_points, fill_tag, width, color) –can draw the the “closed polygon” –Use “fill_tag = 1” for filling the polygon (if fill_tag = 0, no filling) –Use “width” for controlling the width of the line (any positive real val) –Use “color” for controlling the gray level of the color 0: black, 1: white, 0~1: gray value // bounding box float tx[4], ty[4]; tx[0] = minx; ty[0] = miny; tx[1] = minx; ty[1] = maxy; tx[2] = maxx; ty[2] = maxy; tx[3] = maxx; ty[3] = miny; myps.DrawPolygon(tx, ty, 4, 0, 1.0f);

11 demo.cpp - 5 Draw a line (x1,y1) – (x2,y2) DrawLine(float x1, float y1, float x2, float y2, float width=1.0f, float color=0.0f); Draw a circle at center (cx, cy) with radius “radius”. DrawCircle(float cx, float cy, float radius, int fill=0, float width=1.0f, float color=0.0f); Show a test string “Text” at (x, y) DrawText(float x, float y, char *Text, int Scale=12, float color=0.0f);

12 demo.cpp - 6 After all drawings, you should call “myps.CloseFile()”.