I have a python 3 script which uses 'convert' (a unix/linux utliity) to convert multiple SVG files to a single PDF file. Works very well from my Windows 10 box using the Ubuntu Linux command line, but not in repl.it.
Any alternatives or tips ?
I've seen python SVG convert utilities but not sure if any work with multiple SVG files to one PDF file
def convert_to_pdf(): print("Tidying files...") shutil.rmtree(str(directory_in_str)+"/out") print("Converting to PDF (can take a while)...") cmd = 'convert '+str(directory_in_str)+'/*.svg '+str(directory_in_str)+'/'+str(magid)+"_"+str(issueid)+'.pdf' returned_value = subprocess.call(cmd, shell=True) # returns the exit code in unix print('PDF conversion process ended with value: ', returned_value) if returned_value == 0: print('PDF conversion completed OK') else: print ('PDF conversion failed?')
convert program isn't available in the Repl.it shell, so I'm afraid your script can't work on the platform as it relies on that specific program.