DOC to Any Converter

Will doc2any support Microsoft Office 365 Cloud version?

Hi There,

We use doc2any for some conversions in our Scrivener product and are having repeated issues where at least two dozen users of Microsoft Office 365 have had import/export problems using the default Doc2Any via Microsoft Office converters.

My guess is that this is an issue with Office 365 being all or partially web-based, so it doesn't have the same libraries for Doc2Any to hook into--that or the libraries are just different and Doc2any can't use them effectively.

Many users use Win 8 and report that exporting from RTF to DOCX hangs on an "converting" screen, and converting to DOC opened as an empty file in Word. (Some of these users were also converting with English and Hebrew text, but not all, but I'm not sure that's relevant since I can do the same with Word 2013 in Win7 without getting those errors. Debugging the issue, I can see the problem resides with doc2any as the Scrivener process does not hang - only doc2any process hangs.

For import, the users simply got an empty document with the title of the file.

As an addendum to this, these users with the import problem are using 365 ProPlus, which they say is a desktop installation that runs locally. So maybe this is just an issue with changed libraries that Doc2Any isn't handling properly?

I'm not sure there's much I can do about this if it's all Doc2Any's end other than send you a report and ask if there's a new bug fix we can download, or if there is a way we can determine more specifically which version of Office is installed and not show the doc2any converter options if it's 365. I'm not even sure though if this is *all* flavors of 365 or just some, e.g. those without a local installation. I'm not entirely clear how 365 works.

Any guidance here would be much appreciated. We are using doc2any 3.5.0.1.

Customer
----------------------------------------------

Will doc2any support Microsoft Office 365 Cloud version?
Thanks for your message, Microsoft Office 365 is a Cloud Office, it doesn't support MS Office OLE Automation, so you need to install MS Office 2007 or 2010 or 2012 in order to convert office files to PDF files by Doc2Any Command Line application.

If you wish convert office files to PDF files on the cloud, we suggest you may use VeryPDF Cloud API Platform,

http://www.verypdf.com/online/cloud-api/try-and-buy.html

You can use VeryPDF Cloud API Platform to convert office files to PDF files and process PDF files easily, you needn't install anything to your local server, this may an alternative solution for you.

VeryPDF

DOC to Any Converter

How to call doc2any.exe from PHP source code?

Dear Sir

I am evaluating your product and I require some help.
Our proposed portal is being developed in Php running on Tomcat.

The requirement:

A user loads a word / excel / ppt document. Let us say the user loads test.doc. The document is renamed to user1011.doc based on a logic and is uploaded in a directory called upload.

The first page of test.doc needs to be converted to a gif file user1011.gif. This should be saved in the upload folder.

This is what I have done so far:

Moved the following three files to the root directory of localhost: cimage.dll, doc2any.exe and pdftoolsdk.dll.

In the php program I placed the following codes relevant to doc2any.

$infile=$directory . $filname;
$outfile= "uploads/" . $docname . ".gif";
echo $infile; returns uploads/v.doc
echo "";
echo $outfile; returns uploads/v.gif
$timage=$dir .'\doc2any.exe -nooffice -pagerange 1 ' .$infile . $outfile;
$result = exec($timage) ;
if(! $result )
{
    die('Problem with doc2any :: ' . mysql_error());
}

When executed I get an error message:

Problem with doc2any ::

Please let me know where I am going wrong.

Can I also convert the first page of a pdf upload?

What sort of licensing needs to be purchased? We plan to host this portal on Godaddy server sometime in July.

Appreciate your comeback.

Regards
Customer
----------------------------------------------------------
This problem is caused by permission restrictions in SYSTEM user account, you can use VeryPDFComRunCmd COM to call doc2any.exe from PHP code to try again.

VeryPDFComRunCmd is an EXE COM Component which can be used to launch any EXE or Office application from ASP, PHP, C#, .NET etc. program languages. VeryPDFComRunCmd COM is a freeware.

https://www.verydoc.com/blog/verydoc-release-notes-verydoc-releases-an-exe-com-of-verypdfcomruncmd-exe-today-verypdf-exe-com-does-allow-you-to-call-ms-office-and-any-exe-application-from-asp-php-c-net-etc-program-languag.html

http://www.verypdf.com/dl2.php/VeryPDFComRunCmd.zip

You can use following ASP code to call any EXE or MS Office without any permission problem,

<%

set VeryPDFCom = Server.CreateObject("VeryPDFCom.RunCmd")
dim nRetVal, bRet
bRet = VeryPDFCom.RunCmd("D:\verydoc\doc2any.exe D:\test.doc D:\out.pdf", 5, 0)
strRet = VeryPDFCom.RunCmd2("D:\verydoc\doc2any.exe D:\test.doc D:\out.pdf", 5)
Response.Write strRet & vbCrlf

%>

This is a PHP source code example to call doc2any.exe by VeryPDFComRunCmd COM interface,

<?php

$VeryPDFCom = new COM("VeryPDFCom.RunCmd") or Die ("Did not connect");
$strRet = VeryPDFCom->RunCmd2("D:\verydoc\doc2any.exe D:\test.doc D:\out.pdf", 5);

?>

You can use VeryPDFComRunCmd COM to overcome limitations in SYSTEM user account easily, please give it a try.

You can also refer to more solutions to overcome limitations in SYSTEM user account from following web pages,

https://www.verydoc.com/blog/failed-to-call-doc2any-exe-from-c-or-vb-net-source-code.html
https://www.verydoc.com/doc-to-any-shell.html
https://www.verydoc.com/blog/running-doc2any-as-a-scheduled-task.html
https://www.verydoc.com/blog/failed-to-call-doc2any-exe-from-java-application-to-convert-pptx-and-docx-files-to-pdf-files.html
https://www.verydoc.com/blog/cannot-test-doc2any-on-net.html
https://www.verydoc.com/blog/running-doc2any-from-java-program-by-run-as-service-option.html
https://www.verydoc.com/blog/how-to-call-doc2any-exe-from-asp-code.html

>>Can I also convert the first page of a pdf upload?

If you wish convert first page of PDF file to image file, you can use VeryPDF PDF to Image Converter Command Line software,

http://www.verypdf.com/app/pdf-to-image-converter/try-and-buy.html

>>What sort of licensing needs to be purchased? We plan to host this portal on Godaddy server sometime in July.

You need to purchase DOC to Any Converter Command Line Server License,

https://www.verydoc.com/doc-to-any.html

VeryDOC

PostScript to Image Converter

[VeryDOC Release Notes] VeryDOC Releases a new version of Postscript to Image Converter Command Line to support halftone and without halftone functions

VeryDOC Releases a new version of Postscript to Image Converter Command Line today, the new version has features to enable and disable halftone function when you convert color Postscript and PDF files to black and white image files, here is the command line options,

VeryDOC Postscript to Image Converter Command Line v2.0
Web: http://www.verypdf.com
Web: https://www.verydoc.com
Email: support@verypdf.com
Build: May 27 2014
-------------------------------------------------------
Key features in PS to Image Converter:
   Convert postscript files to various image formats.
   Use disk cache to render postscript to image files at any resolution.
   Various compression arithmetic for output TIFF files.
-------------------------------------------------------
Usage: ps2image.exe [options] [Options] <PS Files>
  -f <int>         : first page to print, from 1 to max page
  -l <int>         : last page to print, from 1 to max page
  -r <int>         : set resolution when render ps to image files
  -c <string>      : set compression method to generated TIFF files
    -c lzw         : Compress TIFF using LZW arithmetic
    -c packbit     : Compress TIFF using packbits arithmetic
    -c g3          : Compress TIFF using CCITT G3 arithmetic
    -c g4          : Compress TIFF using CCITT G4 arithmetic
    -c rlebmp      : Compress BMP using RunLength arithmetic
  -b <int>         : set bitcount when render ps to image files
  -forcebw         : force to create Black and White image file
  -debug           : print debug message
  -silent          : suppress log message
  -$ <string>      : input registration key

Example:
   ps2image.exe C:\input.ps C:\output.tif
   ps2image.exe -c g3 C:\input.ps C:\output.tif
   ps2image.exe -c g4 C:\input.ps C:\output.tif
   ps2image.exe -c lzw C:\input.ps C:\output.tif
   ps2image.exe -c packbit C:\input.ps C:\output.tif
   ps2image.exe C:\input.ps C:\output.jpg
   ps2image.exe C:\input.ps C:\output.bmp
   ps2image.exe C:\input.ps C:\output.pcx
   ps2image.exe C:\input.ps C:\output.png
   ps2image.exe C:\test\*.ps C:\test\*.jpg
   ps2image.exe C:\filelist.txt

If you wish convert a color EPS, PS, PDF file to black and white TIFF file with halftone processing, please run following command line, the default is work in halftone mode,

ps2image.exe -r 300 -b 1 test.eps _test.eps.halftone.tif

This is original color EPS file,

[VeryDOC Release Notes] VeryDOC Releases a new version of Postscript to Image Converter Command Line to support halftone and without halftone functions

This is the converted black and white TIFF file with halftone processing,

[VeryDOC Release Notes] VeryDOC Releases a new version of Postscript to Image Converter Command Line to support halftone and without halftone functions

If you wish disable halftone processing, please run following command line,

ps2image.exe -r 300 -b 8 -forcebw test.eps _test.eps.no_halftone.tif

[VeryDOC Release Notes] VeryDOC Releases a new version of Postscript to Image Converter Command Line to support halftone and without halftone functions

The new version of Postscript to Image Converter Command Line is also support PDF format as input format, it can convert PDF file to a new PDF, Postscript, PS, EPS, TIFF, PNG, JPG, BMP, PCX, TGA, etc. formats, the following are some sample command lines,

ps2image.exe -c rlebmp -r 300 -b 8 test.ps _test.ps.bmp
ps2image.exe -c rlebmp -r 300 -b 8 test.eps _test.eps.bmp
ps2image.exe -r 300 -b 1 test.eps _test.eps.halftone.tif
ps2image.exe -r 300 -b 8 -forcebw test.eps _test.eps.no_halftone.tif
ps2image.exe -r 300 -b 1 verypdf.pdf _verypdf.pdf.halftone.tif
ps2image.exe -r 300 -b 8 -forcebw verypdf.pdf _verypdf.pdf.no_halftone.tif
ps2image.exe verypdf.pdf _verypdf.pdf.ps
ps2image.exe verypdf.pdf _verypdf.pdf.pdf
ps2image.exe test.eps _test.eps.pdf
ps2image.exe multi-page-test.ps _multi-page-test.ps.pdf

Postscript to Image Converter Command Line can be downloaded from following web page,

https://www.verydoc.com/ps-to-image.html
https://www.verydoc.com/ps2img.zip

if you encounter any problem, please feel free to let us know, we are glad to assist you asap,

http://support.verypdf.com/open.php

PDF to Vector Converter

[VeryDOC Release Notes] VeryDOC PDF to Vector Converter Command Line does support -vector, -vectorplus, -vectorgray options

VeryDOC has released a new version of PDF to Vector Converter Command Line today, the new version is support -vector, -vectorplus, -vectorgray options, these options will render PDF file to vector graphics first, print vector graphics to Windows Printer and create XPS, PCL, Postscript etc. file formats.

https://www.verydoc.com/pdf-to-vector.html
https://www.verydoc.com/pdf2vec_cmd.zip

-vector                  : render PDF page to vector EMF before printing
-vectorplus         : render PDF page to vector EMF with GDIPlus before printing
-vectorgray         : render PDF page to vector EMF with grayscale before printing

Some Command Line examples,

pdf2vec.exe drawing.pdf _out_drawing.xps
pdf2vec.exe -vector drawing.pdf _out_drawing_vector.xps
pdf2vec.exe -vectorplus drawing.pdf _out_drawing_vectorplus.xps
pdf2vec.exe -vectorgray test.pdf _out_drawing_vectorgray.xps
pdf2vec.exe -vectorgray test.pdf _out_drawing_vectorgray.pcl
pdf2vec.exe -vectorgray -psmode 0 test.pdf _out_drawing_vectorgray.ps

This is original PDF file, it is contain color information,

[VeryDOC Release Notes] VeryDOC PDF to Vector Converter Command Line does support -vector, -vectorplus, -vectorgray options

With -vectorgray option, we can convert all color objects to grayscale colorspace in a new XPS file, here is a screenshot of output XPS file,

[VeryDOC Release Notes] VeryDOC PDF to Vector Converter Command Line does support -vector, -vectorplus, -vectorgray options

This XPS file was created from following command line,

pdf2vec.exe -vectorgray test.pdf _out_drawing_vectorgray.xps

-vectorplus option does use GDIPlus module to render PDF file to XPS file, this is original PDF file, this PDF file is contain lots of drawings,

[VeryDOC Release Notes] VeryDOC PDF to Vector Converter Command Line does support -vector, -vectorplus, -vectorgray options

The following output XPS file is created by -vector option,

pdf2vec.exe -vector drawing.pdf _out_drawing_vector.xps

[VeryDOC Release Notes] VeryDOC PDF to Vector Converter Command Line does support -vector, -vectorplus, -vectorgray options

The following output XPS file is created by -vectorplus option,

pdf2vec.exe -vectorplus drawing.pdf _out_drawing_vectorplus.xps

 

[VeryDOC Release Notes] VeryDOC PDF to Vector Converter Command Line does support -vector, -vectorplus, -vectorgray options

-vectorplus and -vector two parameters have some difference on output XPS file, you can download the trial version and test them by yourself.

PDF Viewer OCX Control

How to use PDF Viewer OCX (ActiveX Control) to view the PDF file from memory?

Is there any complete reference/documentation (website, Document or CHM-file) to the PDFView ActiveX control?

I have downloaded the free trial version of the control, to demo the features of the control to our customer, and would like to use the OpenPDFFromMem - method, but as I see is there only some examples to illustrate some of the features of the control.

Best regards
Customer
--------------------------------------------------
Thanks for your message, OpenPDFFromMem() function does open and view the PDF file from memory,

BOOL OpenPDFFromMem(long lpPDFData, long nPDFDataLen, LPCTSTR lpszUserPwd, LPCTSTR lpszOwnerPwd);

Please refer to following C++ example for this function,

void CSampleDlgDlg::OnBnClickedButtonOpen()

{

    char szFilter[] ="PDF File (*.pdf)|*.pdf||";

    CFileDialog  fSaveDlg(TRUE,"","",

        OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,

        szFilter,this);

    if(fSaveDlg.DoModal() != IDOK)

        return;

    CString strFileName = fSaveDlg.GetPathName();

 

#if 0

    m_PDFViewer.OpenPDF(strFileName, "", "");

   

#else

    //----------------------------------------------------------------

    //

    // Memory Open

    //

    //----------------------------------------------------------------

    CString tmp = _T( "" );

    HANDLE          hFile = ::CreateFile( strFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );

    if ( hFile == INVALID_HANDLE_VALUE )

    {

        tmp.Format( _T( "CreateFile ERROR [CODE = %d]" ), GetLastError() );

        AfxMessageBox( tmp );

        return;

    }

 

    DWORD            dwRead;

    DWORD            dwSize = ::GetFileSize( hFile, NULL );

    BYTE*              pBuffer = new BYTE[ dwSize ];

    memset(pBuffer, 0, dwSize);

 

    if ( !::ReadFile( hFile, (LPVOID)pBuffer, dwSize, &dwRead, NULL ) )

    {

        tmp.Format( _T( "ReadFile ERROR [CODE = %d]" ), GetLastError() );

        AfxMessageBox( tmp );

 

        ::CloseHandle( hFile );

        return;

    }

 

    ::CloseHandle( hFile );

 

    BOOL bRes = m_PDFViewer.OpenPDFFromMem((long)pBuffer, dwSize, "", "" );

    if ( !bRes )

    {

        AfxMessageBox( _T( "Open error!" ) );

    }

#endif

 

    CString csCurrentPage = _T( "" );

    csCurrentPage.Format( _T( "Current Page : %d" ), m_PDFViewer.GetCurrentPage() );

    AfxMessageBox( csCurrentPage );

 

    m_PDFViewer.SetMsgCallbackWnd((long)m_hWnd);

}

 

VeryDOC