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

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
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,

image

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

image

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

image

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

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
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,

image

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,

image

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,

image

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

pdf2vec.exe -vector drawing.pdf _out_drawing_vector.xps

image

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

pdf2vec.exe -vectorplus drawing.pdf _out_drawing_vectorplus.xps

 

image

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

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
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

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
pdf to dwg converter

PDF to DWG Converter. How to convert a multi-page PDF file to single page DWG files?

I have a PDF file with 2 pages, I want convert each page to a DWG file, I need to PDF to DWG Converter software, where to get it?

Thank you.
Customer
------------------------------------------------
You may download VeryDOC PDF to DWG Converter Command Line software from following web page to try,

https://www.verydoc.com/pdf-to-dwg-dxf.html
https://www.verydoc.com/pdf2dwg.zip

you can run following command line to convert your PDF file to DWG files, one PDF page will create one DWG file,

pdf2dwg.exe D:\downloads\test.pdf  D:\downloads\out-%d.dwg

This is original PDF file with 2 pages,

image

Here are converted two DWG files, one PDF file will create one DWG file,

image

This is a screenshot of converted DWG file,

image

VeryDOC

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)