I use Synopse to work with PDF . How can you programmatically add the contents of one file to the end of another file ?. Or by any other means or methods. Not paid. I use the Delphi XE environment

    1 answer 1

    Synopse does not allow working with ready-made pdf-files. As indicated on the official forum - this is the library for creating (writing) pdf, and not for reading them. In the todo list, the authors of this task either.

    To combine several pdf files into one, you can use several tools, the most popular (in my opinion) is Coherent , which allows you to work with command line parameters. You need the following command, described on the Coherent website:

    cpdf one.pdf two.pdf three.pdf -o merged.pdf

    Naturally, it is advisable to specify the full paths to the files, including the cpdf itself.

    Note: it is advisable to read the FAQ from the Coherent website at the bottom of the page.

    • Does Coherent support Cyrillic in teams? I’m such a cpdf -add-text "Привет мир" one.pdf -o two.pdf command cpdf -add-text "Привет мир" one.pdf -o two.pdf gives an error - gregor
    • Is this what you are trying to write in the console, or are you passing programmatically with parameters on the command line? - kami
    • Yes, the console gives an error. But when I try to transfer in the program in ShellExecuteEx in the parameters for example the following line of text C:\\Downloads\\Новая папка , only `C: \\ Downloads \` - gregor falls into the pdf document
    • @gregor The console works with OEM-coding, which may be incorrectly perceived by the application in terms of national characters. Parameters should be enclosed in double quotes " , otherwise each space will be considered a new passed parameter. It is better to work with executable files via CreateProcess, rather than ShellExecute. - kami
    • Fixed on CreateProcess . The result is the second parameter for it 'cpdf.exe -add-text "file: // C: / Users / Greg / Downloads / New folder" -topleft 15 -font-size 8 -color "blue" D: \ Projects \ Data \ 20160505141418867.pdf -o D: \ Projects \ Data \ 20160505141418870.pdf'` Output result file://C:/Users/Greg/Downloads/ - gregor