doc to any converter

Convert html to PDF output result UTF-8(for PHP)

Question:How to convert html to PDF and show output result UTF-8.I use some library but it doesn't support UTF-8.Please tell me which libraries I can use and how to solve this problem. BMW, I need to run the conversion from PHP, is there any solution on VeryDOC?

Answer: According to your needs, maybe you can have a free trial of this software: VeryDOC Doc Converter COM, by which you can convert HTML to PDF from PHP code and output result UTF-8. When output UTF-8, there is no special parameters as it supports UTF-8 as default. UTF-8 (UCS Transformation Format—8-bit) is a variable-width encoding that can represent every character in the Unicode character set. It was designed for backward compatibility with ASCII and to avoid the complications of endianness and byte order marks in UTF-16 and UTF-32. So when you have UTF-8 requirement of output, this software can help you make that. Please check more related information of this software on its website, in the following part, let us check how to make it work.

Step 1. Free download Doc Converter COM

  • This is COM version and there is DLL Library, or Command Line available, enabling developers to access the converter via any programming or scripting languages, such as Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc.
  • When downloading finishes, there will be a zip file. Please extract it to some folder then you can use it normally.

Step 2. Convert HTML to PDF using PHP

    • When you use this software, first you need to install it. Download PDFcamp Printer Pro and unzip "doc2pdf_com_trial.zip" package to a folder, and run "install_as_exe.bat" file to install the DocConverter COM into your system, then you can  run HTML2PDF.exe by script from MS Dos Windows.
    • When you call the conversion from PHP code, please refer to the following code template:

Example 1
<?php
$url = "http://www.verypdf.com";
$path = "C:\\test.pdf";
$com = new COM("PdfOut.PdfCreator");
$com->html2PDF = $url;
$com->fileName = $path;
$com->Doc2PDFViaSocket();
?>

Example 2:
<?php
$PdfCreator =new COM("PdfOut.PdfCreator") or die("Cannot start PdfCreator");
$PdfCreator->Doc2PDFCommandLine(' "c:\input.doc" "c:\output.pdf" ');
$PdfCreator = null;
?>
Example 3:
<?php
$url = "http://www.verypdf.com";
$path = "C:\\test.pdf";
$com = new COM("PdfOut.PdfCreator");
$com->Doc2PDFCommandLine("\"$url\" \"$path\" \"paperType=0,PrintHTMLBackground=yes,overwrite=yes\"");

During the using, if you have more questions about it, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
image to xps converter

How to create XPS file from ASP?

In this article, I will share a method of creating XPS file and add company logo on output XPS file from ASP. The software I will use is named as VeryDOC Image to XPS Converter, by which you can create XPS file from image files easily. And this converter is command line version software, so you can call this software from ASP directly.  If you need, this software also allows you to call it from Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc. Using the COM object (or DLL Library, or Command Line), file conversions can be done consecutively or simultaneously.

The XPS document format consists of structured XML markup that defines the layout of a document and the visual appearance of each page, along with rendering rules for distributing, archiving, rendering, processing and printing the documents. Notably, the markup language for XPS is a subset of XAML, allowing it to incorporate vector-graphic elements in documents, using XAML to mark up the Windows Presentation Foundation (WPF) primitives. Now this file formats is widely used in printing area. For creating XPS file, please refer to the following steps.

Step 1. Download Image to XPS Converter Command Line

  • When downloading finishes, you can find a zip file. Please unzip it and then check elements, usage, parameters carefully.
  • When you call this software from ASP, please refer to the example in user manual.

Step 2. Create XPS file from image together with ASP.

  • This software supports the following image file formats:TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, TGA, WMF, EMF, PCX. You can create XPS from those image file.
  • Here is one code template about calling this software from ASP, please have a check.

Please by following steps to call img2xps.exe inside a special user account,
1. Please download and install EXEShell COM Library (freeware) from following URL first,
https://www.verydoc.com/exeshell.html
https://www.verydoc.com/download/exeshell.zip
2. Please use following ASP code to run the conversion inside a special user account,
~~~~~~~~~~~~~~~~~
<%
Set comEXEShell = Server.CreateObject("exeshell.shell")
RootPath = Server.MapPath(".") & "\"
EXEFile = RootPath & "img2xps\img2xps.exe"
InFile = RootPath & "test.tif"
OutFile = RootPath & "out.xps"
strCommandLine = EXEFile & " " & InFile & " " & OutFile
response.write strCommandLine & "<br>"
comEXEShell.RunCommandLine "UserName", "Password", strCommandLine
Set comEXEShell = Nothing
%>
~~~~~~~~~~~~~~~~~

The above example can help you create XPS from tiff file. During the using, if you have any question, please contact us as soon as possible.

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

How to convert image to XPS file from C#?

         In this article, I will show you how to convert image to XPS from C# programming language. The software I will use is named as VeryDOC Image to XPS Converter Command Line, by which you can also call it together with any programming or scripting languages, such as Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc.

Supported image file formats:TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, TGA, WMF, EMF, PCX
Supported system: all the Window platforms both of 32-bit and 64-bit.

When you use this software, you are able to specify any other printer name to instead of "Microsoft XPS Document Writer" printer; after converting, you can add watermark to output XPS file at any place in any kind of forms. Please check more functions of this application on homepage, in the following part, I will show you how to call it from C#.

Step 1. Free download Image to XPS Converter Command Line

  • You can download it to your computer and have a free trial then decide whether this software is good for you or not.
  • When downloading finishes, you will get a zip file. Please extract it to some folder then you can call it normally.
  • When you use this software, please refer to the usage and following examples.

Step 2. Convert image to XPS from C#

  • Here is the usage for your reference:img2xps.exe [options] <Image files> [XPS files]
  • When call it from C#, please refer to the following code template:
  • Make use of the PROCESS class available in SYSTEM.DIOGNOSTICS namaspace, use the following piece of code to execute the img2xps.exe file,
    ~~~~~~~~~~~~~~~~~
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;

    namespace ConsoleApplication1
    {
        class Program
    {
    static void Main(string[] args)
    {
    Process proc = new Process();
    proc.StartInfo.FileName = @"C:\\img2xps.exe";
    string strArguments = "";
    strArguments += " D:\\temp\\sample.tif D:\\temp\\out.xps";
    Console.WriteLine(strArguments);
    proc.StartInfo.Arguments = @strArguments;
    proc.Start();
    proc.WaitForExit();
    }
    }
    }
    ~~~~~~~~~~~~~~~~~

  • Here are some parameters for your reference:
  • -printer <string> : set printer name to create XPS file
    -paper <string>   : set paper size to XPS format
      auto   : retrieve paper size from image file
      number : standard paper size
      others : user defined paper size
    -xoffset <int>  : specify left offset for output image
    -yoffset <int>  : specify top offset for output image
    -width <int>    : specify width for output image
    -height <int>   : specify height for output image
    -getpagecount   : read page count from input image file
    -wtext <string> : set watermark on output XPS pages
    -wtype <int>    : type of watermark
      0 : normal watermark
      1 : watermark on header
      2 : watermark on footer
    -wf <string> : font name of watermark
    -wh <int> : font height of watermark
    -ww <int> : font width of watermark
    -wb : specify bold font
    -wi : specify an italic font
    -wu : specify an underlined font
    -ws : specify a strikeout font
    -wo <int> : opacity of watermark, from 0 to 100
    -wa <int> : angle of watermark
    -wc <string> : color of watermark,

During the using, if you have any question, please contact us as soon as possible.

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

Dynamically insert content into PDF files with PHP

Question:I have an eBook in word that I convert to PDF before distributing to my clients. I'd like to dynamically insert their email address into all links in the eBook to allow them access to the members-only content on my site, and I'd like to do this on the fly, as part of the book download process.I've briefly looked at some software and website, but I was wondering what specific technique I'd use to insert this data.I was thinking I'd insert an email token string where I want the email address to go, and then use some function to update those tokens in the PDF document. Can anyone point me in the right direction? I have PHP experience, but not with editing / generating PDF documents from PHP. Is there any solution on VeryDOC?

Answer: According to your needs, I guess you can convert word to PDF eBook and then stamp PDF by email address then this matter can be solved. You can insert data in the format of stamping PDF. If you feel this solution is good, please refer to the following part.  The software I use here is named as VeryDOC DOC to Any Converter, by which you can convert doc to PDF and directly insert email address as stamp. And this is command line version software, you can call it from PHP. If you need to use the SDK version, there is also one available. In the following part, I will show you how to process it.

Step 1. Free download DOC to Any Converter Command Line

  • As this is command line version software, when downloading finishes, it is a zip file. Please extract it to some folder then you can call the executable file from MS Dos Windows.
  • When you use this software, please refer to the usage and example.

Step 2. Convert word to PDF eBook and inset data as email address.

  • When you need to convert word to PDF eBook and insert data as email address, you may need the following parameters and please refer to the following command line templates:
  • -useprinter     : Convert DOC files to other formats via virtual printer
    -width <int>    : Set page width to PDF file
    -height <int>   : Set page height to PDF file
    -xres <int>     : Set X resolution to image file
    -yres <int>     : Set Y resolution to image file
    -bitcount <int> : Set color depth for image conversion
    -compression <int>     : Set compression for TIFF image
    -wtext <string>        : watermark on printed document
    -wtype <int>           : type of watermark
        0 : normal watermark
        1 : watermark on header
        2 : watermark on footer
    -wf <string>           : font name of watermark
    -wh <int>              : font size of watermark
    -wb                    : specify bold font
    -wi                    : specify an italic font

    Some examples:
    doc2any.exe -wtext "support@verydoc.com" "C:\in.doc" C:\out.pdf
    doc2any.exe -wtext "support@verydoc.com" -wc "0000FF" "C:\in.doc" C:\out.pdf
    doc2any.exe -wtext "support@verydoc.com" -wx 100 -wy 100 "C:\in.doc" C:\out.pdf

  • When you need to call it from PHP, please refer to the following code template:
  • <?php
        $exeshell =new COM("exeshell.shell") or die("Can't start exeshell");
        $exeshell->RunCommandLine("UserName", "Password", ' "C:\doc2any.exe" "C:\test.doc" "C:\out.pdf" ');
        $exeshell = null;
    ?>

During the using, if you have any question, please contact us as soon as possible.

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

Is there a better way to convert files into PDF files using PHP?

Question:What is on VeryDOC the best way to convert uploaded files of any kind (.doc, .docx,...) into a PDF-file using nothing but PHP. Is it even possible to do so?I looked at FPDF, but this creates the PDF files from text.An other solution previously given was to use the some library on your server, but unfortunately, my server doesn't support this library...What is the best way to convert to files my users upload on my site to PDF files?

Answer: According to your needs, maybe you can have a free trial of this software: VeryDOC Doc Converter COM,by which you can convert files of Microsoft Word, PowerPoint, Excel, JPG, PNG, GIF, and HTML to PDF. And this COM is available via an easily integrated COM object (or DLL Library, or Command Line), enabling developers to access the converter via any programming or scripting languages, such as Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc.  This COM is quite popular for developer to install it on sever for file formats conversion, so I guess there should have any problem to make it work on your server. Please know more detail information on its homepage, in the following part, let us check how to use this software.

Step 1. Free download Doc Converter COM

  • This is COM version, when downloading finishes, there will be a zip file. Please extract it to some folder then you can check related element and help documents.
  • When you open it then you will find code template of PHP, simply follow it then you can use this software easily at once.

Step 2. Convert Files to PDF using PHP

  • When you need to create PDF from files using PHP, please refer to the following code templates:

Some examples for call DocConverter COM Service from PHP code:
By this code template, we can create PDF from file URL, which means you can also convert website to PDF.

Example 1:
<?php
$url = "http://www.verypdf.com";
$path = "C:\\test.pdf";
$com = new COM("PdfOut.PdfCreator");
$com->html2PDF = $url;
$com->fileName = $path;
$com->Doc2PDFViaSocket();
?>
By this code template, we can convert local file to PDF.
Example 2:
<?php
$PdfCreator =new COM("PdfOut.PdfCreator") or die("Cannot start PdfCreator");
$PdfCreator->Doc2PDFCommandLine(' "c:\input.doc" "c:\output.pdf" ');
$PdfCreator = null;
?>
Example 3:
<?php
$url = "http://www.verypdf.com";
$path = "C:\\test.pdf";
$com = new COM("PdfOut.PdfCreator");
$com->Doc2PDFCommandLine("\"$url\" \"$path\"
\"paperType=0,PrintHTMLBackground=yes,
overwrite=yes\"");
?>

During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 4.5/10 (11 votes cast)
VN:F [1.9.20_1166]
Rating: -6 (from 8 votes)