Questions Tagged With documenthttps://answers.axonivy.com/tags/document/?type=rssquestions tagged <span class="tag">document</span>enMon, 11 May 2020 00:53:04 -0400Ivy.wf().documents() - How to change root destination path of uploaded fileshttps://answers.axonivy.com/questions/4560/ivy-wf-documents-how-to-change-root-destination-path-of-uploaded-files<p>I use <code>Ivy.wf().documents()</code> and want to upload files to my own folder ("c:/documents/attachments/ID"). But I got an error as it always upload to a default roor folder "C:\00.FIXIT_Designer7.0.14\files\application\" and just allows add subs folder inside:</p> <pre><code>Ivy.wf().documents() .add(new ch.ivyteam.ivy.workflow.document.Path("c:/documents/attachments/ID")) .write() .withContentFrom(file); IOException: Unable to create directory C:\00.FIXIT_Designer7.0.14\files\application\c:\documents\attachments\ID </code></pre> <p>(double "c:\")</p> <p>Is there any way to change it?</p> <p>Thank you!</p>nvtanMon, 11 May 2020 00:53:04 -0400https://answers.axonivy.com/questions/4560/ivy-wf-documents-how-to-change-root-destination-path-of-uploaded-filesdocumentIs the DocumentFactory able to convert *.docx to *.pdf?https://answers.axonivy.com/questions/3919/is-the-documentfactory-able-to-convert-docx-to-pdf<p>For a curernt application, we have the requirement to convert <em>.docx and </em>.doc files to a *.pdf file and append a page. Can this be done with the DocumentFactory or do we have to implement this by utilizing other tools?</p> <p>The Aspose API should be able to do that, but I couldn't find an example on the Jira page for the DocumentFactory.</p> <p>Edit - due to a <a href="https://answers.axonivy.com/questions/2526/aspose-evaluation-only-message">related question</a>, I could answer it myself. Both scenarios are possible by utilizing Aspose directly.</p> <pre><code> Document doc = new Document("C:\\Users\\m.hoffmann\\Documents\\Die Kultur im Sudetenland.docx"); DocumentBuilder docBuilder = new DocumentBuilder(doc); docBuilder.moveToDocumentEnd(); docBuilder.insertBreak(BreakType.PAGE_BREAK); docBuilder.writeln("Dies ist ein Beispielausgabetext, welcher mit Aspose eingefügt wurde"); docBuilder.getDocument().save("C:\\Users\\m.hoffmann\\Documents\\asposeOutputEdited.pdf", SaveFormat.PDF); </code></pre>mhoffmannWed, 14 Aug 2019 06:13:37 -0400https://answers.axonivy.com/questions/3919/is-the-documentfactory-able-to-convert-docx-to-pdfdocumentAspose "Evaluation only" messagehttps://answers.axonivy.com/questions/2526/aspose-evaluation-only-message<p><img alt="Evaluation only" src="http://answers.axonivy.com/upfiles/aspose-evaluation-only.png"></p> <p>I create documents with Aspose, which is offically part of IvyAddOns. Why is on each generated document an "evaluation only" message?</p> <p>This code generates the document:</p> <pre><code>import com.aspose.words.Document; Document doc = new Document("C:\\temp\\test.docx"); doc.save("C:\\temp\\test.pdf"); </code></pre>Alex SuterFri, 24 Mar 2017 10:02:34 -0400https://answers.axonivy.com/questions/2526/aspose-evaluation-only-messageasposedocumentIvy.wf().documents() - How to update an existing document with new content?https://answers.axonivy.com/questions/2128/ivy-wf-documents-how-to-update-an-existing-document-with-new-content<p>I got an error when trying to update the content for an existing document that's managed by <code>Ivy.wf().documents()</code>. This api doesn't have the method <code>update</code> so I just tried with following code:</p> <p><code>ivy.wf.documents().add("newfolder\\hello.pdf").write().withContentFrom(new File("sourcefolder\\file2.pdf", false));</code></p> <p>The message looks like: </p> <p><code>IOException: File newfolder\hello.pdf already exists PersistencyException: Cannot create file 'D:\work\AxonIvyDesigner6.3.0\files\application\newfolder\hello.pdf' for document 'newfolder\hello.pdf'</code></p> <p>Yeah! it's correct! But, I want to update this existing file with new content.</p> <p>I already tried to use method <code>delete</code> first:</p> <p><code>ivy.wf.documents().delete(new ch.ivyteam.ivy.workflow.document.Path("newfolder\\hello.pdf"));</code></p> <p>Or, trying to delete the physical file; but it did not work.</p> <p>Thanks for your checking!</p>nvhuongSat, 22 Oct 2016 11:06:36 -0400https://answers.axonivy.com/questions/2128/ivy-wf-documents-how-to-update-an-existing-document-with-new-contentdocumentivy