You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modified version of `print_version.ps` from [ghostinthepdf](https://github.com/neex/ghostinthepdf). Prints useful information about the configuration of Ghostscript.
9
+
10
+
## `list_files.ps`
11
+
12
+
Prints all filenames contained in the specified directory (by default `/tmp/`) to the output page.
13
+
14
+
### Variables
15
+
16
+
```
17
+
% how many chars per line at most
18
+
/charactercount 100 def
19
+
20
+
% Which directory should be listed
21
+
/target_directory (/tmp/*) def
22
+
```
23
+
24
+
## `print_file.ps`
25
+
26
+
Writes the content of the specified file to the page. The used function needs to be specified at the end of the code:
27
+
28
+
-`PrintFileBase64`: Prints files encoded as Base64 onto the page, useful for binary files.
29
+
30
+
```
31
+
(/usr/bin/bash) PrintFileBase64
32
+
```
33
+
34
+
-`PrintFileAsText`: Prints the content of files onto the page, respects newlines. Useful for simple text files, but binary files can also be printed if needed.
35
+
36
+
```
37
+
(/etc/passwd) PrintFileAsText
38
+
```
39
+
40
+
### Variables
41
+
42
+
```
43
+
% how many chars per line at most
44
+
/charactercount 100 def
45
+
```
46
+
47
+
## `embed_files_in_pdf.ps`
48
+
49
+
This script embeds all files in the specified directory (by default `/tmp/`) in the output PDF file using PDFMark.
50
+
Only works with `pdfwrite` device for that reason.
51
+
Use `extract_pdf_attachments.py` to extract all files from the PDF, or any capable PDF reader.
52
+
53
+
### Variables
54
+
55
+
```
56
+
% How many files can be included at most
57
+
/maxFileCount 100 def
58
+
59
+
% The folder with wildcard which will be embedded
60
+
/targetFolder (/tmp/*) def
61
+
62
+
% Enables printing error information to the page
63
+
/printErrors false def
64
+
```
65
+
66
+
## `long_running_embed_files.ps`
67
+
68
+
Similar to `embed_files_in_pdf.ps`, but runs for a specified amount of time and collects short-lived files by scanning the specified directory in regular intervals.
69
+
70
+
### Variables
71
+
72
+
```
73
+
% how often files should be checked
74
+
/totalRounds 1000 def
75
+
76
+
% How many milliseconds to sleep inbetween rounds
77
+
/sleepDuration 10 def
78
+
79
+
% How many files can be included at most
80
+
/maxFileCount 100 def
81
+
82
+
% The folder with wildcard which will be embedded
83
+
/targetFolder (/tmp/*) def
84
+
85
+
% Enables printing error information to the page
86
+
/printErrors false def
87
+
```
88
+
89
+
## `write_file.ps`
90
+
91
+
Writing files onto the disk. The used function needs to be specified at the end of the code:
92
+
93
+
- Writing plaintext: Useful for simple and short text file:
94
+
95
+
```
96
+
outfile (Output string which will be written to outfile) writestring
97
+
```
98
+
99
+
-`base64Decode`: Base64 decodes the input string. Useful for embedding (binary) files in PostScript. Decoding and writing to file:
0 commit comments