Converting doc/ pdf /txt/ rtf / docx to HTML files

I have some queries
regarding implementation of Aspose .


  1. Can a file after conversion be taken in a variable before being saved to the
    disk .Specifically converting doc/ pdf /txt/ rtf / docx to
    HTML files.


  2. Aspose works on specific formats . What is the method suggested to conform
    the mime type of a file before using it in a appropriate converting module.


  3. Is there a generic method which could auto detect file type and convert
    accordingly.





    regards
irfan.

Hi Irfan,

Thanks for your inquiry.

mediatrendit:

1. Can a file after conversion be taken in a variable before being saved to the disk

You can save the output file in memory stream. Please check the overloaded Document.Save methods from here:
http://www.aspose.com/docs/display/wordsnet/Save+Method
mediatrendit:

Specifically converting doc/ pdf /txt/ rtf / docx to HTML
files.

You can convert Doc, Docx, Rtf etc files to HTML file format by using Aspose.Words. You can load file
formats mentioned at following documentation link into Aspose.Words DOM.
http://www.aspose.com/docs/display/wordsnet/LoadFormat+Enumeration

Once you have loaded a file of LoadFormat into Aspose.Words DOM, you can easily convert it to HTML.
mediatrendit:

2. Aspose works on specific formats . What is the method suggested to conform the mime type of a file before using it in a appropriate converting module.

It would be great if you please share some more detail about this query.

Please check the SaveFormat enumeration from here:
http://www.aspose.com/docs/display/wordsnet/SaveFormat+Enumeration

SaveFormat indicates the format in which the document is saved. If save format is invalid, Document.Save method throws ‘Invalid save format requested’ exception.
mediatrendit:

3. Is there a generic method which could auto detect file type and convert accordingly.

Aspose.Words.Document constructor automatically detects the file format. You need to load the document of LoadFormat into Aspose.Words.Document and save it by using Document.Save method.

Hope this answers your query. Please let us know if you have any more queries.

Apsose word converts the word documents and variants of text files (doc,docx,rtf,txt etc.), To convert the files properly I need to identify the MIME type of the input file . when I use the methods given in http://www.aspose.com/docs/display/wordsjava/LoadFormat, the pdf file gives me file format as "txt". Hence I am unable to find the the correcrt format of the file to be converted.

Enquiry about the generic function was regarding the above as well to detect the MIME type and switch between two aspose products word and pdf
(Evaluating Aspose pdf), when an input is given.

The code is in java so java API references will be very helpful<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

regards,Irfan

Facing some issues with Aspose.pdf <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am unable to initialise the pdf document. Please find the error in the attachment .

Details are as follows:

Language : java

code used :

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(docPath);

where docPath is the variable storing the documents path.

Java Version :

java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.04.2)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

Operation System:

Ubuntu 10.04.2 LTS

Aspose jar used:

aspose-pdf-kit-4.7.0.jar, aspose-pdf-4.3.0.jar, aspose-pdf-4.3.0-jdk14.jar

would appreciate a quick response.

Regards,

irfan.

Hi Irfan,

Thanks for your inquiry.

mediatrendit:


Apsose word converts the word documents and variants of text files (doc,docx,rtf,txt etc.), To convert the files properly I need to identify the MIME type of the input file . when I use the methods given in API Reference|Aspose.Words for Java, the pdf file gives me file format as “txt”. Hence I am unable to find the the correcrt format of the file to be converted.

Enquiry about the generic function was regarding the above as well to detect the MIME type and switch between two aspose products word and pdf

FileFormatInfo contains data returned by FileFormatUtil document format detection methods. You do not create instances of this class directly. Objects of this class are returned by DetectFileFormat methods. To detect the file format, please read following documentation link.
http://www.aspose.com/docs/display/wordsjava/How+to++Detect+the+File+Format

Please also check the code examples shared at following documentation link for your kind reference.
http://www.aspose.com/docs/display/wordsjava/FileFormatInfo
mediatrendit:


Facing some issues with Aspose.pdf

I am unable to initialise the pdf document. Please find the error in the attachment .

Aspose jar used:

aspose-pdf-kit-4.7.0.jar, aspose-pdf-4.3.0.jar, aspose-pdf-4.3.0-jdk14.jar


Your query is related to Aspose.Pdf component. I am moving this forum thread to Aspose.Total forum. My colleagues from Aspose.Pdf team will reply you about your query.

Hi Irfan,


Thanks for contacting support.

In order to get the MIME type of input document, please try using the following code snippet.

[C#]

// load source document<o:p></o:p>

java.nio.file.Path source = java.nio.file.Paths.get("c:/pdftest/Conversion_Test.pdf");

// print the MIME type of file

System.out.println(java.nio.file.Files.probeContentType(source));

mediatrendit:

<span style=“color: black; font-family: “Calibri”,“sans-serif”;”>Facing some
issues with Aspose.pdf <o:p></o:p>

I am unable to initialise the pdf document. Please find the error in the attachment .

Details are as follows:

Language : java

code used :

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(docPath);

where docPath is the variable storing the documents path.

Java Version :

java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.04.2)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

Operation System:

Ubuntu 10.04.2 LTS

Aspose jar used:

aspose-pdf-kit-4.7.0.jar, aspose-pdf-4.3.0.jar, aspose-pdf-4.3.0-jdk14.jar

Hi Irfan,


Can you please share some details regarding the issue which you are facing so that we can further investigate this problem in our environment. We are sorry for your inconvenience.

pls find attached the error report…

Hi Irfan,


Thanks for sharing the log file.

Recently we have noticed any issue while using Aspose.Pdf for Java with default Locale, where Locale is en_IN. When setting the locale using following code lines, StackOverflowError appears.

Locale llLocale = new Locale(“en”, “IN”);
Locale.setDefault(llLocale);

For the sake of correction, I have logged this problem as PDFNEWJAVA-33952 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time.

Can you please share some details regarding your working environment. We are sorry for this inconvenience.

Hi Irfan,


In addition to Nayyer comments, to confirm the problem cause please test your code by changing Locale to English before instantiating Aspose.Pdf object as following and share the results.

Locale.setDefault(Locale.ENGLISH);

Best Regards,

The issues you have found earlier (filed as PDFNEWJAVA-33952) have been fixed in Aspose.Pdf for Java 9.1.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(5)