LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-11-2023, 05:47 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 9.2
Posts: 1,237

Rep: Reputation: 51
how to combine a .txt file and a .pdf file into one .pdf file


I have a large number of files of the same name in pairs, one is a .pdf file and the other is a .txt file and I need to combine each pair into one pdf file, for example:
myFirstFile.pdf + myFirstFile.txt = myFirstFileMerged.pdf
mySecondFile.pdf + mySecondFile.txt = mySecondFileMerged.pdf
...
I am not very familiar with scripts and I need one to do the job since the only solution I have found so far is to first convert the .txt file to a .pdf file, save it and then merge them as a single .pdf file.

I could not see a CLI or GUI command to do that and the only solution I found is through the browser (many clicks for each file).

Could someone suggest a way/link/hint to do that in Linux Bash?

Thank you for your help.
 
Old 01-11-2023, 05:51 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,391

Rep: Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535Reputation: 1535
Install and take a look at ghostscript, that will give you CLI / scriptable tools for dealing with text and PDF files.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] wget question, how to combine -i foo.txt and -O name.jpg lleb Linux - General 12 07-24-2021 06:31 PM
[SOLVED] read txt file into an array and make a second txt file zimbot Linux - General 12 09-05-2015 02:39 PM
[SOLVED] input txt into some txt boxes siickboii Linux - Newbie 3 10-10-2012 06:28 PM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 07:38 AM
Combine multiple one column text file into one text file with multiple colum khairilthegreat Linux - Newbie 7 11-23-2007 02:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration