4 ms·
I had to write a one-off script to convert a bunch of pptx files to pdf. (yeah I know pandoc exists, but it doesn’t always work as well as the real deal) And t
by kaba0 5y ago
I had to write a one-off script to convert a bunch of pptx files to pdf. (yeah I know pandoc exists, but it doesn’t always work as well as the real deal)
And to my surprise I found an example and could indeed open the file in the real office powerpoint, export as a pdf file and close it for each one of them with like 8 lines of code. Hell, I could have probably done it in parallel with a single flag (but that didn’t work on my version)
In a way, Windows out-UNIXed linux, because contrary to the latter’s philosophy, you don’t really get communication between components because everything is unstructured.
- mmcgaha 5y agoThis is not an example of windows doing anything unix like. We simply have to take a different mindset when using Windows vs unix. Windows has always had a way to communicate between components and that it does better than anything else.
- cma 5y agoUp until the networked era at least where its communication between components was the source of thousands and thousands of vulnerabilities for Windows (ActiveX, thumbnail renderer, office apps embedded in emails...).
- kaba0 5y agoHow is using multiple single-purpose tools to solve a problem not “unix-like”? Isn’t that the reason why people like POSIX-shells? It just happens that windows has better integration between even GUI apps, which is directly available from the shell. Linux’s analog would be dbus, but that is not integrated with the shell natively.
- mmcgaha 5y agoWith a unixy design, powerpoint would only edit powerpoint documents and it would send the data to other programs for printing or PDF creation. In your case, the powerpoint program would never be called. You would simply send the powerpoint data to a program that converts powerpoint to maybe postscript, and you would send the postscript to ghostscript to make a PDF. The unix like a approach is a bit more decoupled. I cannot think of a single GUI program on linux that works this way (xfig maybe?) but in my mind, this would be the unix way. Of course by the mid 90s, the unix way lost out to the windows way so our GUI world on linux has something of a personality disorder.
- kaba0 5y agoIt can’t really send powerpoint data to any other program, can it? It is a highly complex data format, and the logical conclusion would be n*m tools for interconverting between different formats — that would be bloated as hell. The fact is, sometimes we do need a program that fulfills a whole domain, not just a specific problem. For this conversion problem domain, there is pandoc for example. I will be hated for this, but systemd would be another good example — you really can’t and should not subdivide such a complex problem into more specific ones. It should be tackled in one place (although systemd is quite modular besides that)
- netizen-936824 5y agoCould ppt files be represented as pure text/strings? I believe docx can, as its some sort of XML structure Where is the complexity and overhead? Ppt exports PDF files just fine, would it really be so complicated to move that to an external program?
- kaba0 5y agoAnd then write another program for ppt-to-txt and every conceivable format? You might then say, okay, then first create an intermediary format but depending on program domain that may be more hassle than its worth it. Powerpoint is made for correctly understanding .ppt(x) files. This complicated functionality should probably not be replicated at other programs as well.
- pjmlp 5y agoSome UNIXes had something similar, NeWS, OpenSTEP DSOs (now macOS XPC),... And even GNU/Linux could offer a similar experience if the ecosystem would actually buy into D-BUS or KParts, but that isn't never going to happen, and when only in a specific distribution, with the distribution specific apps, largely ignored by the remaining eco-system.
- blibble 5y agolibreoffice --headless --invisible --convert-to pdf *.pptx
- bathtub365 5y agoThis probably falls under the poster’s "it doesn’t always work as well as the real deal” qualification.
- deleted 5y ago[deleted]
- kaba0 5y agoBesides that, it is somewhat ad-hoc. Like, ok, libreoffice has a cli interface (with their own conventions, mind you), but what about inkscape? Or a browser? And I’m sure there are plenty of programs under windows that also doesn’t provide such an interface, but I still feel that it is something linux should copy.
- blibble 5y agoinkscape: https://wiki.inkscape.org/wiki/index.php/Using_the_Command_Line https://wiki.inkscape.org/wiki/index.php/Using_the_Command_L... how is it ad-hoc? this IS the unix interface: command line params mixed with stdin/stdout instead of DDE/OLE/COM/DCOM/DCOM+/ActiveX/CLR/whatever_it_is_this_week bullshit (mixed in with mountains of crap in the registry)
- yjftsjthsd-h 5y agoHow is it any more ad-hoc than powerpoint having an option to PDF and exposing that to PS?
- delusional 5y agoThe difference is that all the tools you just used were created by Microsoft. It's essentially a curated experience. From that angle, it's a fucking mess. If Office didn't support PDFs and was created by a 3rd party. The integration would be really cool. As it stands, powerpoint should just have a bulk convert feature instead of scripting language hooks. The reason bash is cool is because i can open it up, and run all these different programs written by different people, in different languages, for different use cases, and they all just work. It's the diversity of the ecosystem that makes the interoperability so cool. If it was all made by a single company, I'd say the usability is a fucking mess.
- netizen-936824 5y agoSomeone else in another thread here that PS shines when you use the object models full-in. Personally I think bash shines in the opposite way as everything is a string and everything is a file, which as you mention, allows everything to work together
- kaba0 5y agoThere is nothing inherent in PS’s model to disallow some third-party app from working. Also, having to create per-usecase bug-prone parsing for everything is pretty terrible. It is okay for copying a file or whatnot, but it is definitely not okay for more complex tasks. And indeed, for those you would just use a single-purpose tool, like pandoc for my given example.