Bonjour à tous,

J'ai un problème très intéréssant:
Je suis entrain d'insérer des "null space coding" entre deux caractères dans un document PDF. Les codes Ascii invisible et plus particulièrement les null space coding comme 1C, 1D, 1E et 1F servent à ajouter un espace entre deux caractères ayant 0.0 comme width (longeur). Pourcela on parle du null space.
Mon problème est que lorsque j'insère un null space "1C" par exemple entre deux caractères , il s'affiche comme un espace ayant un width spécifique dans le document!! et non pas comme un null space!!.

Voici mon code (en utilisant PDFBox):

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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
public class Test1 extends PDFTextStripper{
    private static String v;
 
    public Test1() throws IOException {
        super.setSortByPosition(true);
    }
 
    private static Test1 tes; 
    private static final String src="...";
    private static PDPageContentStream content;
    private static PDType1Font font; 
    public static void CreatePdf(String src) throws IOException, COSVisitorException{
    PDRectangle rec= new PDRectangle(400,400);
    PDDocument document= null;
    document = new PDDocument();
    PDPage page = new PDPage(rec);
    document.addPage(page);
    PDDocumentInformation info=document.getDocumentInformation();
 PDStream stream= new PDStream(document);
 stream.addCompression();
 
    info.setAuthor("PdfBox");
    info.setCreator("Pdf");
    info.setSubject("Stéganographie");
    info.setTitle("Stéganographie dans les documents PDF");
    info.setKeywords("Stéganographie, pdf");
    content= new PDPageContentStream(document, page, true, false );
    font= PDType1Font.HELVETICA;
 
String hex = "4C1C61205374E967616E6F677261706869652064616E7320504446";
System.out.println(hex.length());
 
       StringBuilder sb = new StringBuilder();
        for (int count = 0; count < hex.length() - 1; count += 2)
    {
        String output = hex.substring(count, (count + 2));
 
 
        int decimal = Integer.parseInt(output, 16);
         sb.append((char)decimal);
    }
        String tt=sb.toString();
         System.out.println("la valeur tt est: "+tt);
 
 
 
    content.beginText();
    content.setFont(font, 12);
    content.appendRawCommands("15 385 Td\n");
   content.appendRawCommands("("+tt+")"+"Tj\n");
    content.endText();
   content.close();
    document.save("doc.pdf");
    document.close();       
    }
Donc remarquons comment il existe 1C après 4C et avant 61 (entre S et t). Mais quand j'ouvre le document, j'obtiens "L a Stéganographie dans PDF" au lieu de "La Stéganographie dans PDF".

SVP j'ai beaucoup besoin de vos aides.
Merci d'avance,