Advertisement
Guest User

Untitled

a guest
Mar 13th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. [10:53:41] Amurag has joined
  2. [10:53:56] Amurag is now known as Anurag
  3. [10:54:15] Anurag: hello
  4. [10:54:21] Anurag: i need some help
  5. [10:56:23] elias_a: Anurag: Just ask.
  6. [10:56:33] mikekaganski: Anurag: please don't ask to ask - nobody knows how to help until you ask a real question
  7. [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
  8. [10:57:43] Anurag: use*
  9. [10:57:52] mikekaganski: "exact same as in docx"?
  10. [10:58:39] Anurag: yes means all alignment and content position must be in it's position
  11. [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?
  12. [11:00:08] mikekaganski feels bad for many typos
  13. [11:00:24] Anurag: I failed to apply libreoffice in my code
  14. [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?
  15. [11:02:02] Anurag: bundle libreoffice as a library
  16. [11:02:28] mikekaganski: Anurag: there's no such option. LibreOffice is not a library. It's an office suite.
  17. [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.
  18. [11:03:52] Anurag: but is it possible to use this office suite to convert docx file to pdf with code
  19. [11:04:27] mikekaganski: Anurag: you can call it like "path/to/soffice --convert-to pdf path/to/docx"
  20. [11:04:58] mikekaganski: Anurag: https://help.libreoffice.org/latest/en-US/text/shared/guide/start_parameters.html
  21. [11:05:34] Anurag: i am using a docx file as a template and after doing the modification a pdf will be generated
  22. [11:06:21] mikekaganski: Anurag: and how is the modification made?
  23. [11:07:24] elias_a: Anurag: Why do you have to use a DOCX file as a template?
  24. [11:07:41] Anurag: by using the backend calculation that user input in the front end in php
  25. [11:08:11] mikekaganski: Anurag: so doesn't calling soffice like I shown above work for you?
  26. [11:09:14] Anurag: i call it but nothing happens
  27. [11:09:14] mikekaganski: (I suppose that using docx or odf is another issue - I'm trying to understand where is Anurag's propbem)
  28. [11:10:02] mikekaganski: Anurag: does it work if you open the docx in LO normally, and then export in UI?
  29. [11:10:14] elias_a: mikekaganski: Yep - you are right. Just saying that layout problems happen because DOCX is broken by definition.
  30. [11:11:19] Anurag: yes it works
  31. [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?
  32. [11:12:33] mikekaganski: Anurag: what is *exact* command you use which fails?
  33. [11:12:51] Anurag: ok wait
  34. [11:17:59] Anurag has disconnected: Ping timeout: 246 seconds
  35. [11:18:07] Anurag has joined
  36. [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
  37. [11:20:15] Anurag: and also there is no image in textarea ( textarea is totally disapper)
  38. [11:21:08] Anurag: i am using PhpWord for setting the in docx file
  39. [11:21:10] Anurag: soffice --headless --convert-to txt filename.doc
  40. [11:21:26] Anurag: for converting it into pdf
  41. [11:21:34] mikekaganski: "--convert-to txt" ???
  42. [11:22:05] Anurag: sorry in place of txt pdf is there
  43. [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"
  44. [11:23:03] mikekaganski: sigh
  45. [11:23:17] Anurag: yes
  46. [11:23:28] mikekaganski tries to understand which problem is real
  47. [11:24:09] mikekaganski: Anurag: and when you generate PDF using UI, is the result the same, with disturbed content?
  48. [11:24:33] Anurag: i haven't test in UI
  49. [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".
  50. [11:27:09] Anurag: not tested in UI i want to do it programmatically
  51. [11:30:31] Anurag: do you have any solution
  52. [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
  53. [11:31:27] elias_a: Yes - start graphical LibreOffice from shell, do the stuff manually and read the probable errors.
  54. [11:35:35] Anurag has disconnected: Ping timeout: 244 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement