Giter VIP home page Giter VIP logo

Comments (2)

rcrath avatar rcrath commented on August 23, 2024 1

This is my workaround which I might just keep and retire the uno* apps. I'm only doing a few dozen files at a time, so the efficiency is not really a factor.

#!/bin/bash 
#this set of commenting is all relevant to the broken unoconv command.
#echo "If you recieve \"Error: Unable to connect or start own listener\"  Just 
#run the command again. If you get pyuno bridge error try running \"pip 
#install unotools\""

#put this bash script in the same folder as the odt files 
# you want to make pdf from. it will safely convert all of them
#create a folder in current directory with current date
mkdir -p $(date +%y%m%d)
# copy all odt files from current directory to the dated one just created and enter the folder
cp *.odt $(date +%y%m%d)
cd $(date +%y%m%d)

These are just the unoconv* commands, ignore.
#unoconv -f pdf -e SelectPdfVersion=1 -e ExportNotes=false '*.odt' 
# unoserver --daemon
# unoconvert --convert-to pdf *.odt -

# loop through all the odt files in the dated folder and 
# cconvert them to pdf, leaving the originals intact. 
for f in .*.odt
do
	echo "converting $f to pdf"
	soffice --headless --convert-to pdf *.odt
done

# go up to the folder the script is in, create a folder called pdf if 
# it is not already there, and copy the pdf files into a subfolder 
# of the pdf named with the current date.  
mkdir -p ../pdf/$(date +%y%m%d)
mv *.pdf ../pdf/$(date +%y%m%d)
cd ..
# delete the temprorary dated folder 
rm -R $(date +%y%m%d)

from unoserver.

regebro avatar regebro commented on August 23, 2024

from unoserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.