List of usage examples for java.lang System err
PrintStream err
To view the source code for java.lang System err.
Click Source Link
From source file:RenderingTEXT_RENDER_MODE_FILL_STROKE5.java
public static void main(String[] args) { Document document = new Document(); try {// w w w . java 2 s . com PdfWriter.getInstance(document, new FileOutputStream("RenderingTEXT_RENDER_MODE_FILL_STROKE5.pdf")); document.open(); Paragraph p = new Paragraph("Text Rendering:"); document.add(p); Chunk chunk = new Chunk("rendering test"); chunk.setTextRenderMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE, 0.5f, new Color(0x00, 0x00, 0x00)); document.add(chunk); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:ImagesDefaultWRAPInANewLinePDF.java
public static void main(java.lang.String[] args) { Document document = new Document(); try {/*from w w w . j a v a 2 s .c o m*/ PdfWriter.getInstance(document, new FileOutputStream("ImagesDefaultWRAPInANewLinePDF.pdf")); document.open(); Image imageRight = Image.getInstance("logo.png"); imageRight.setAlignment(Image.LEFT); for (int i = 0; i < 100; i++) { document.add(new Phrase("Text ")); } document.add(Chunk.NEWLINE); document.add(imageRight); for (int i = 0; i < 100; i++) { document.add(new Phrase("Text ")); } } catch (Exception e) { System.err.println(e.getMessage()); } document.close(); }
From source file:InvokeMain.java
public static void main(String[] argv) { //+/*from w w w . j ava 2s . c om*/ try { // First, find the class. Class c = Class.forName("InvokeMain"); // RECURSION System.out.println(c); // Create the array of Argument Types Class[] argTypes = { argv.getClass(), // array is Object! }; // Now find the method Method m = c.getMethod("main", argTypes); System.out.println(m); // Create the actual argument array Object passedArgv[] = { argv }; // Now invoke the method. m.invoke(null, passedArgv); } catch (Exception e) { System.err.println(e); } //- }
From source file:ParagraphsPDF.java
public static void main(String[] args) { Document document = new Document(); try {/*w ww . j av a 2 s .co m*/ PdfWriter.getInstance(document, new FileOutputStream("ParagraphsPDF.pdf")); document.open(); Paragraph p1 = new Paragraph( new Chunk("This is my first paragraph. ", FontFactory.getFont(FontFactory.HELVETICA, 10))); p1.add("The default leading is 1.5 times the fontsize. "); p1.add(new Chunk("new chunks ")); p1.add(new Phrase("new phrases. ")); document.add(p1); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:PersisTest.java
public static void main(String args[]) { if (args.length == 0) { System.err.println("Usage: java PersisTest filename"); System.exit(-1);// w w w .j a v a 2s. c o m } new PersisTest(args[0]).show(); }
From source file:PDFMetaSubjectKeywordsCreatorAuthorCreationDateProducer.java
public static void main(String[] args) { Document document = new Document(); try {/*from www . j a va 2 s .c om*/ PdfWriter.getInstance(document, new FileOutputStream("PDFMetaSubjectKeywordsCreatorAuthorCreationDateProducer.pdf")); document.addSubject("the subject"); document.addKeywords("key words"); document.addCreator("this is the creator"); document.addAuthor("author"); document.addCreationDate(); document.addProducer(); document.open(); document.add(new Paragraph("Hello World")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:com.idega.util.FileLocalizer.java
public static void main(String[] args) { if (args.length != 2) { System.err.println("Wimp. I need two parameters, input file og directory and output file"); System.err.println("Usage java FileLocalizer input output"); return;/*from w ww .j av a2s.c o m*/ } File in = null; BufferedWriter out = null; Properties props = new Properties(); try { in = new File(args[0]); } catch (Exception e) { System.err.println("Auli. Error : " + e.toString()); return; } try { out = new BufferedWriter(new FileWriter(args[1])); } catch (java.io.IOException e) { System.err.println("Auli. Error : " + e.toString()); return; } try { findRecursive(in, props); props.list(new PrintWriter(out)); } catch (Exception e) { System.err.println("Error reading or writing file : " + e.toString()); } try { out.close(); } catch (java.io.IOException e) { System.err.println("Error closing files : " + e.toString()); } }
From source file:Main.java
public static void main(String[] args) { try {//w w w .ja v a 2s . co m BufferedReader input = new BufferedReader(new FileReader(args[0])); ArrayList list = new ArrayList(); String line; while ((line = input.readLine()) != null) { list.add(line); } input.close(); Collections.reverse(list); PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(args[1]))); for (Iterator i = list.iterator(); i.hasNext();) { output.println((String) i.next()); } output.close(); } catch (IOException e) { System.err.println(e); } }
From source file:ParagraphAttributesSpaceAfterPDF.java
public static void main(String[] args) { Document document = new Document(); try {// w ww.ja v a2 s . c om PdfWriter.getInstance(document, new FileOutputStream("ParagraphAttributesSpaceAfterPDF.pdf")); document.open(); Paragraph p = new Paragraph( "This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. "); p.setSpacingAfter(15f); document.add(p); document.add(p); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:TemplatesDrawPDF.java
public static void main(String[] args) { Document document = new Document(); try {//from ww w .j a v a2s. co m PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("TemplatesDrawPDF.pdf")); document.open(); PdfContentByte cb = writer.getDirectContent(); PdfTemplate template = cb.createTemplate(500, 200); template.moveTo(0, 200); template.lineTo(500, 0); template.stroke(); template.circle(250f, 100f, 80f); template.stroke(); cb.addTemplate(template, 0, 0); document.newPage(); cb.addTemplate(template, 2, 0, 0, 2, -200, 400); } catch (Exception e) { System.err.println(e.getMessage()); } document.close(); }