Bonjour a tous
Petite question
J'essaye de comprendre le functionnement de DynamicPDF (permetant de creer des pdf avec java)
Pour bien commencer j'ai repris les exemples (logique lol)
Pour la plus grande partie sa va c'est clair mais il y a 3 lignes dont je comprends pas a quoi ils correspondent.
Voila mon incomprehension se situe la:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 package testpdf; import com.cete.dynamicpdf.*; import com.cete.dynamicpdf.pageelements.Label; public class Sans_titre1 { public static void main(String args[]) { // Create a document and set it's properties Document objDocument = new Document(); objDocument.setCreator("HelloWorld.java"); objDocument.setAuthor("Your Name"); objDocument.setTitle("Hello World"); // Create a page to add to the document Page objPage = new Page(PageSize.LETTER, PageOrientation.PORTRAIT, 54.0f); // Create a Label to add to the page String strText = "Hello World...\nFrom DynamicPDF Generator " + "for Java\nDynamicPDF.com\n AFPA Développeur en Informatique"; Label objLabel = new Label(strText, 0, 0, 504, 100, Font.getHelvetica(), 18, TextAlign.CENTER); // Add label to page objPage.getElements().add(objLabel); // Add page to document objDocument.getPages().add(objPage); // Outputs the document to file objDocument.draw("HelloWorld.pdf"); } }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 Page objPage = new Page(PageSize.LETTER, PageOrientation.PORTRAIT, 54.0f);
a quoi correspond le 54.0f ?
et la:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 Label objLabel = new Label(strText, 0, 0, 504, 100, Font.getHelvetica(), 18, TextAlign.CENTER);
a quoi correspondent les 0,0,504,100, 18
Merci d'avence si quelqun a une idee![]()
Partager