stiv Posted March 6, 2023 Share Posted March 6, 2023 (edited) Hola chicos, tengo un problema con mi código de autoit, porque quiero unir pdfs. (pdf24), y no funciona y no muestra ningún error. No se cual puede ser el error pero no me aparece el pdf adjunto. $PDF24 = "C:\Archivos de programa\PDF24\pdf24.exe" Dormir ( 4000 ) $archivo1 = "C:\Usuarios\jpelayo\Documentos\prueba\cuota.pdf" $archivo2 = "C:\Usuarios\jpelayo\Documentos\prueba\reporte.pdf" $salida = "C:\Usuarios\jpelayo\Documentos\prueba\salida.pdf" Dormir ( 4000 ) $comando = '/mergePDF"' & $archivo1 & '" "' & $archivo2 & '" "' & $salida & '"' Dormir ( 4000 ) Ejecutar ( $PDF24 & ' ' & $comando ) Revelación $PDF24 = "C:\Archivos de programa\PDF24\pdf24.exe" Dormir ( 4000 ) $archivo1 = "C:\Usuarios\jpelayo\Documentos\prueba\cuota.pdf" $archivo2 = "C:\Usuarios\jpelayo\Documentos\prueba\reporte.pdf" $salida = "C:\Usuarios\jpelayo\Documentos\prueba\salida.pdf" Dormir ( 4000 ) $comando = '/mergePDF"' & $archivo1 & '" "' & $archivo2 & '" "' & $salida & '"' Dormir ( 4000 ) Ejecutar ( $PDF24 & ' ' & $comando ) Edited March 6, 2023 by stiv Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 6, 2023 Moderators Share Posted March 6, 2023 Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team stiv 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Danp2 Posted March 6, 2023 Share Posted March 6, 2023 Replace your Run line with the following and you should see that your command is incorrectly formatted -- ConsoleWrite($PDF24 & ' ' & $command & @CRLF) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
stiv Posted March 6, 2023 Author Share Posted March 6, 2023 @Danp2 I made the change that you recommended with "Console Write" However, it does not create the new joined file. I don't know what it could be, and I have the autoit version 3.3.145 Link to comment Share on other sites More sharing options...
Danp2 Posted March 6, 2023 Share Posted March 6, 2023 @stivThe switch to ConsoleWrite is intended to be temporary to allow you to see the error in your code. You will eventually switch back to Run(), but first you need to review the console output to examine the string that you were passing to Run() and correct its format. This is what I got and it is clearly incorrect -- C:\Program Files\PDF24\pdf24.exe /mergePDF"C:\Users\jpelayo\Documents\prueba\cuota.pdf" "C:\Users\jpelayo\Documents\prueba\reporte.pdf" "C:\Users\jpelayo\Documents\prueba\salida.pdf" Hints: You need quotes around program path because it contains spaces and you are missing a space following the "mergePDF" parameter. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
stiv Posted March 6, 2023 Author Share Posted March 6, 2023 @Danp2 I validated spaces and quotes and it didn't work for me, if I went without finding the error. however I found a useful script that unifies them. Run("pdftk.exe C:\Users\jpelayo\Documents\prueba\cuota.pdf C:\Users\jpelayo\Documents\prueba\reporte.pdf cat output C:\Users\jpelayo\Documents\prueba\archivo_unificado.pdf") I would have liked to do it with pdf24. argumentum 1 Link to comment Share on other sites More sharing options...
Solution bdr529 Posted March 7, 2023 Solution Share Posted March 7, 2023 "c:\Program Files\PDF24\pdf24-Doctool.exe" -noProgress -profile ""default/good"" -join 1.pdf 2.pdf -outputFile 3.pdf stiv and argumentum 1 1 To community goes all my regards and thanks Link to comment Share on other sites More sharing options...
stiv Posted March 7, 2023 Author Share Posted March 7, 2023 thank you so much, @bdr529 It works correctly with pdf24. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now