L'astuccio a cartellina
Il programma Cartella permette di creare l'esploso di un astuccio a cartellina, senza parti incollate, per le carte de visite.
Ha dimesioni 105x70mm con spessore modificabile da un parametro sulla riga di comando.
Dopo l'introduzione del tool per la creazione delle credit card è stato aggiunto il parametro --format= che può valere cdv (opzione di default) e produce cartelline atte a contenere carte de visite con il formato appena mostrato.
Se invece vale cc si ottiene una cartellina un po' più piccola adatta a contenere le credit card.
La versione originale del programma prevedeva l'output su un foglio 20x27cm, che tuttora è l'opzione di default; in seguito sono stati aggiunti il 15x20, può essere selezionato con il parametro --paper=Medium e l'A4, selezionabile con il parametro --paper=A4.
Occorre fare attenzione al fatto che alcune combinazioni creano immagini che non sono contenibili nel formato 15x20 e che quindi vengono tagliate.
Come per tutti gli altri, il programma chiamato con il parametro -h o --help mostra la sintassi di utilizzo, come riportato di seguito:
Casasoft Contemporary Carte de Visite Cartella Copyright (c) 2020-2023 Roberto Ceccarelli - Casasoft Usage: Cartella [options]* Options: -a, --aboveimage=VALUE set the image for the top cover -z, --bottomimage=VALUE set the image for the bottom -l, --leftimage=VALUE set the image for the left border -r, --rightimage=VALUE set the image for the right border -f, --frontimage=VALUE set the image for the front -b, --backimage=VALUE set the image for the back -t, --thickness=VALUE set the box thickness (default 5mm) --bordertext=VALUE text to print on left border --font=VALUE text font (default Arial) --fontbold use bold font weight --fontitalic use italic font style --format=VALUE size of the box: 'cdv' or 'cc' (default 'CDV') --orientation=VALUE orientation of the box: 'portrait' or 'landscape' ( default 'PORTRAIT') --paper=VALUE Output paper size: Large (default) 20x27cm Medium 15x20cm A4 210x297mm --sample generate sample images --fillcolor=VALUE set the color used to fill the images (default #FFFFFF) --bordercolor=VALUE set the color used to border the images (default #000000) --dpi=VALUE set output resolution (default 300) --json=VALUE parameters in json format, use --helpjson for sample template Text can be stored in a file instead of a string The file must be referenced as '@filename' --script=VALUE c# script for custom processing, use --helpscript for sample template Text can be stored in a file instead of a string The file must be referenced as '@filename' -o, --output=VALUE set output dir/filename --extension=VALUE file extension for output file (default 'jpg') --tag=VALUE extra info for user scripts Text can be stored in a file instead of a string The file must be referenced as '@filename' --nobanner suppress the banner -h, --help show this message and exit --helpjson show json parameters template --helpscript show script template --man show the man page source and exit --colors list available colors by name --license show program license (AGPL 3.0) Colors can be written in any of these formats: #rgb #rrggbb #rrggbbaa #rrrrggggbbbb #rrrrggggbbbbaaaa colorname (use Cartella --colors to see all available colors) Environment variables The program can read values from these variables: CDV_OUTPATH Base path for output files CDV_DPI Resolution for output files CDV_FILL Color used to fill images CDV_BORDER Border color
Per chi la preferisse è anche disponibile la man page (Nuova pagina) Unix
La man page, in formato MarkDown, può essere ottenuta chiamando il programma con l'opzione --man
I parametri possono essere passati in un file in formato json le cui struttura può essere ottenuta con il comando cartella --helpjson il cui output è riportato di seguito:
Casasoft Contemporary Carte de Visite Cartella Copyright (c) 2020-2023 Roberto Ceccarelli - Casasoft Json parameters template for: Cartella { "topImage": "", "bottomImage": "", "leftImage": "", "rightImage": "", "frontImage": "", "backImage": "", "fontBold": false, "fontItalic": false, "font": "Arial", "borderText": "", "spessore": 5, "isHorizontal": false, "targetFormat": 0, "useTestImages": false, "Paper": null, "FillColor": "#FFFFFF", "BorderColor": "#000000", "Dpi": 300, "OutputName": "", "Extension": "jpg", "Script": null, "Tag": null, "FilesList": [] }
Possono essere passate le immagini per ogni faccia della scatola, per quelle non indicate verrà utilizzata una immagine del colore impostato con --fillcolor (per default bianco).
L'opzione -t, o la versione lunga --thickness= definisce lo spessore, in millimetri, dell'astuccio; se mancante viene utilizzato il valore di 5mm.
L'opzione --dpi= (non esiste forma breve) specifica la risoluzione, in dpi, del file di uscita.
Se non indicata viene impostata a 300dpi.
L'opzione -o, o la versione lunga --output=, permette di specificare il pathname (senza estensione) del file generato: se non specificata il file si chiamerà folder.jpg e si troverà nella stessa directory del programma.
Attraverso gli script utente è possibile utilizzare qualsiasi formato in uscita e processare le immagini di ogni lato all'atto del caricamento,
Come per gli altri programmi con il comando Cartella --helpscript si può ottenere un template, riportato di seguito, per scrivere i propri comandi personalizzati.
Casasoft Contemporary Carte de Visite Cartella Copyright (c) 2020-2023 Roberto Ceccarelli - Casasoft ----- // Script template for Cartella /// <summary> /// Custom class initialization /// </summary> public void Init() { } /// <summary> /// Image for final output /// </summary> /// <returns></returns> public MagickImage OutputImage() => null; /// <summary> /// Preprocesses the loaded image for Front /// </summary> /// <param name="image">The loaded image</param> /// <returns>The Processed image</returns> public MagickImage ProcessOnLoadFront(MagickImage image) => image; /// <summary> /// Preprocesses the loaded image for Back /// </summary> /// <param name="image">The loaded image</param> /// <returns>The Processed image</returns> public MagickImage ProcessOnLoadBack(MagickImage image) => image; /// <summary> /// Preprocesses the loaded image for Top /// </summary> /// <param name="image">The loaded image</param> /// <returns>The Processed image</returns> public MagickImage ProcessOnLoadTop(MagickImage image) => image; /// <summary> /// Preprocesses the loaded image for Bottom /// </summary> /// <param name="image">The loaded image</param> /// <returns>The Processed image</returns> public MagickImage ProcessOnLoadBottom(MagickImage image) => image; /// <summary> /// Preprocesses the loaded image for Left /// </summary> /// <param name="image">The loaded image</param> /// <returns>The Processed image</returns> public MagickImage ProcessOnLoadLeft(MagickImage image) => image; /// <summary> /// Preprocesses the loaded image for Right /// </summary> /// <param name="image">The loaded image</param> /// <returns>The Processed image</returns> public MagickImage ProcessOnLoadRight(MagickImage image) => image; -----
Questa immagine mostra un esempio del risultato ottenibile.