Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [10:53:41] Amurag has joined
- [10:53:56] Amurag is now known as Anurag
- [10:54:15] Anurag: hello
- [10:54:21] Anurag: i need some help
- [10:56:23] elias_a: Anurag: Just ask.
- [10:56:33] mikekaganski: Anurag: please don't ask to ask - nobody knows how to help until you ask a real question
- [10:57:03] Anurag: I am a developer and i want to convert docx file to pdf exact same as in docx but failed to implement the libreoffice i previously usly TCPDF,DOMPDF
- [10:57:43] Anurag: use*
- [10:57:52] mikekaganski: "exact same as in docx"?
- [10:58:39] Anurag: yes means all alignment and content position must be in it's position
- [10:59:22] mikekaganski: Anurag: so what is "failed"? is content is not in position, or does conversion fail wirh an error, or didn't you dound how to do that?
- [11:00:08] mikekaganski feels bad for many typos
- [11:00:24] Anurag: I failed to apply libreoffice in my code
- [11:01:18] mikekaganski: "apply libreoffice"? what do you mean? do you want to call external executable? or do you expect to bundle LibreOffice as a library?
- [11:02:02] Anurag: bundle libreoffice as a library
- [11:02:28] mikekaganski: Anurag: there's no such option. LibreOffice is not a library. It's an office suite.
- [11:03:37] elias_a: Another issue is that as DOCX as a technical definition is broken, you will get into problems using it in any case.
- [11:03:52] Anurag: but is it possible to use this office suite to convert docx file to pdf with code
- [11:04:27] mikekaganski: Anurag: you can call it like "path/to/soffice --convert-to pdf path/to/docx"
- [11:04:58] mikekaganski: Anurag: https://help.libreoffice.org/latest/en-US/text/shared/guide/start_parameters.html
- [11:05:34] Anurag: i am using a docx file as a template and after doing the modification a pdf will be generated
- [11:06:21] mikekaganski: Anurag: and how is the modification made?
- [11:07:24] elias_a: Anurag: Why do you have to use a DOCX file as a template?
- [11:07:41] Anurag: by using the backend calculation that user input in the front end in php
- [11:08:11] mikekaganski: Anurag: so doesn't calling soffice like I shown above work for you?
- [11:09:14] Anurag: i call it but nothing happens
- [11:09:14] mikekaganski: (I suppose that using docx or odf is another issue - I'm trying to understand where is Anurag's propbem)
- [11:10:02] mikekaganski: Anurag: does it work if you open the docx in LO normally, and then export in UI?
- [11:10:14] elias_a: mikekaganski: Yep - you are right. Just saying that layout problems happen because DOCX is broken by definition.
- [11:11:19] Anurag: yes it works
- [11:12:06] mikekaganski: all this conversation looks like interrogation, with us asking for some information to be able to help, and only get a word for a question... did Anurag mention OS, or LO version?
- [11:12:33] mikekaganski: Anurag: what is *exact* command you use which fails?
- [11:12:51] Anurag: ok wait
- [11:17:59] Anurag has disconnected: Ping timeout: 246 seconds
- [11:18:07] Anurag has joined
- [11:19:42] Anurag: I am using a docx template and after user input the details it generate pdf but when the pdf is generated alignment of the content is disturbed
- [11:20:15] Anurag: and also there is no image in textarea ( textarea is totally disapper)
- [11:21:08] Anurag: i am using PhpWord for setting the in docx file
- [11:21:10] Anurag: soffice --headless --convert-to txt filename.doc
- [11:21:26] Anurag: for converting it into pdf
- [11:21:34] mikekaganski: "--convert-to txt" ???
- [11:22:05] Anurag: sorry in place of txt pdf is there
- [11:22:55] mikekaganski: Anurag: ok, so now it looks like your "i call it but nothing happens" turned into "it generate pdf but when the pdf is generated alignment of the content is disturbed"
- [11:23:03] mikekaganski: sigh
- [11:23:17] Anurag: yes
- [11:23:28] mikekaganski tries to understand which problem is real
- [11:24:09] mikekaganski: Anurag: and when you generate PDF using UI, is the result the same, with disturbed content?
- [11:24:33] Anurag: i haven't test in UI
- [11:25:27] mikekaganski: oh... me asked: "Anurag: does it work if you open the docx in LO normally, and then export in UI?" - Anurag answered: "yes it works"... later: "i haven't test in UI".
- [11:27:09] Anurag: not tested in UI i want to do it programmatically
- [11:30:31] Anurag: do you have any solution
- [11:31:26] mikekaganski: Anurag: sigh. You came here, asking for help. Everyone here can understand what you *want*. But when you are asked questions that could help others to help you, you are expected to do legwork trying what you are asked, and provide answers, even if you don't see yourself that it's directly relevant. If you knew everything yourself, you'd not have problems, right? So unless you cooperate, no solution
- [11:31:27] elias_a: Yes - start graphical LibreOffice from shell, do the stuff manually and read the probable errors.
- [11:35:35] Anurag has disconnected: Ping timeout: 244 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement