PDF to Vector Converter

How to convert PDF to vector image inside a special user account from ASP code?

In this article, I will show you how to convert PDF to vector image switch between users from ASP code. This method is good when you need to run the conversion from PDF to vector on sever or public computer which has many different users with different accounts.  The vector image could be MF, WMF, SVG, Postscript (PS), EPS, SWF(Flash), XPS, HPGL, PCL etc. The software I use is named as VeryDOC PDF to Vector Converter, which is command line version software, it is quite helpful for developers. Please check more related information on homepage. In the following part, let us check how to use this software.

Step 1. Free download PDF to Vector Converter SDK Server License

  • If you do not need to use this software for developing, please simply use the command line version which also can satisfy your needs.
  • By the SDK server version, you can call this software from from ASP/PHP/C#/.NET/... etc. server side applications. And SDK version will be much more easier for those developers who need to develop software based on this software.
  • When downloading finishes, there will be a zip file. Please extract to some folder then you can check more related elements and information.

Step 2. Convert PDF to vector inside a special user from ASP code.

  • When you use this software, please refer to the code template, usage and help documents.
  • Here is one code template of converting PDF to flash inside a special user from ASP code. Simply change the output file formats and related parameters then you can run the conversion from PDF to vector image casually.
  • Please by following steps to call pdf2vec.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 & "pdf2vec\pdf2vec.exe"
        PDFFile = RootPath & "test.pdf"
        SWFFile = RootPath & "out.swf"
        strCommandLine = EXEFile & " " & PDFFile & " " & SWFFile
        response.write strCommandLine & "<br>"
        comEXEShell.RunCommandLine "UserName", "Password", strCommandLine
        Set comEXEShell = Nothing
    %>
    ~~~~~~~~~~~~~~~~~
    Remark:
    You may encounter Error 1314 in some Windows systems when you switch between user accounts, this is caused by permission setting, please refer to the steps in #2 to solve the 1314 Error.

Please check more related code templates and parameters in help document. During the using, if you have any question, please contact us as soon as possible.

PDF to Vector Converter

How to convert PDF to flash from C#?

    In this article, I will show you how to convert PDF to Flash by C#. The software I use is named as VeryDOC PDF to Vector Converter, by which you can also convert PDF file to EMF, WMF, SVG, Postscript (PS), EPS, SWF (Flash), XPS, HPGL, PCL etc. from C# code. By the developer version of PDF to Vector Converter SDK, you can also run the conversion from Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc.  Please check more detail information of this software on homepage, in the following part, let us check how to use this software.

Step 1. Free download PDF to Vector Converter SDK Developer License

  • For compressing easily, we have compressed this software package to zip file. When downloading finishes, please extract the zip file to some folder then you can use this software normally.
  • There are executable file, code templates, help document and other files. Please run the conversion according to the example.

Step 2. Convert PDF to Flash by C#.

  • Here are some code of convert PDF to Flash by C#, please have a check. Make use of the PROCESS class available in SYSTEM.DIOGNOSTICS namaspace, use the following piece of code to execute the pdf2vec.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:\\pdf2vec.exe";
string strArguments = "";
strArguments += "-swfburst";
strArguments += " D:\\temp\\sample.pdf D:\\temp\\out.swf";
Console.WriteLine(strArguments);
proc.StartInfo.Arguments = @strArguments;
proc.Start();
proc.WaitForExit();
}
}
}
~~~~~~~~~~~~~~~~~
Sample code #2 (C# example),
Please by following steps to call pdf2vec.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 C# code to run the conversion inside a special user account,
~~~~~~~~~~~~~~~~~
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
    class Program
{
static void Main(string[] args)
{
System.Type otype = System.Type.GetTypeFromProgID("exeshell.shell");
Object o = System.Activator.CreateInstance(otype);
otype.InvokeMember("RunCommandLine", System.Reflection.BindingFlags.InvokeMethod, null, o,
new object[] { "UserName", "Password", @"C:\pdf2vec.exe ""C:\test.pdf"" ""C:\out.swf""" });
otype = null;
}
}
}
~~~~~~~~~~~~~~~~~
Remark:
You may encounter Error 1314 in some Windows systems when you switch between user accounts, this is caused by permission setting, please by following steps to solve this 1314 Error,
ERROR 1314:
~~~~~~~~~~~~~
1314 A required privilege is not held by the client. ERROR_PRIVILEGE_NOT_HELD
~~~~~~~~~~~~~
To resolve this issue:
1. Click Start, click Run, type "secpol.msc", and then press ENTER.
2. Double-click "Local Policies".
3. Double-click "User Rights Assignment".
4. Double-click "Replace a process level token".
5. Click "Add", and then double-click the "Everyone" group
6. Click "OK".
7. You may have to logout or even reboot to have this change take effect.

Please check more code templates in help document. During the using, if you have any question, please contact us as soon as possible.

PDF to Vector Converter

-scale option is not work in PDF to Vector Converter SDK

I am trying to use -scale feature from pdf2vec tool when converting to PostScript, but it does not appear to have any effect: same .ps file is produced with out without -scale option. I have tried command line tool, as well as SDK (.DLL). Is there some special syntax required for this option beyond what is on page:

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

Customer
----------------------------
Thanks for your message, you can run following command lines to convert your PDF file to PS files with different "scale" option, the output PS files are not same,

pdf2vec.exe -scale 50 -psmode 0 E:\test.pdf E:\test1.ps
pdf2vec.exe -scale 80 -psmode 0 E:\test.pdf E:\test2.ps

VeryDOC
----------------------------
Thank you very much for the quick response.

I have tested with suggested option, and that worked differently, but with issues, so this is not resolved yet.

1) the file produced with "-scale" option "huge". From 100 KB PDF, the .PS is 41 MB (!!). A non-scale converted .PS file is about 200 KB.

2) When printed, the .PS file is still not doing scaling image, so there is not visible difference. I have tested with 2 different types of printers, with different internal postscript engines, no scaling on any of them.

3) I have observed that the conversion is now done by using a print driver with specific name. To see if the issue of print file size could be resolved, I rename another "print to file" postscript driver to required name, and then the conversion produced expected reasonable postscript size (200KB), but still not resizing/scaling when printed.

I have tested printing directly from PDF reader program, and with "scale" option in the driver it does print resizes. So there is possibly some limitation in the way the PDF2Vec is using "scale" option in the driver.

Attached is a sample PDF file that I was using for testing. This is a file from a third-party customer, so while there is no confidential info in the file, please do not share it with others.

Customer
----------------------------
>>1) the file produced with "-scale" option "huge". From 100 KB PDF, the .PS
is 41 MB (!!). A non-scale converted .PS file is about 200 KB.

This is normal, because "-scale 50 -psmode 0" option will embed all necessary fonts into PS file, these fonts' data will increase PS file size a lot. If you don't want to embed the fonts, you may run following command line directly,

pdf2vec.exe D:\test.pdf D:\out.ps

this command line will create a small PS file from PDF file.

Do you want print the PDF file with "scale" option? if yes, we suggest you may download PDFPrint Command Line product from our website to try,

http://www.verypdf.com/pdfprint/pdfprint_cmd.zip

PDFPrint Command Line product has more options to scale the PDF pages to fit the target printer's paper size, for example,

pdfprint.exe -scale 50 -printer "Microsoft XPS Document Writer" D:\test.pdf

pdfprint.exe -scalex 50 -scaley 50 -printer "Microsoft XPS Document Writer" D:\test.pdf

pdfprint.exe -scalex 50 -scaley 50 -raster2 -printer "Microsoft XPS Document Writer" D:\test.pdf

Can you scale the PDF file and print to your printer correctly with PDFPrint Command Line application?

VeryDOC

DOC to Any Converter

How to convert Office file to PDF from web service applications?

In this article, I will show you how to convert Office file to PDF from web service applications. The software I use is named as VeryDOC Doc Converter COM, by this COM software, we can convert .doc, .xls, .html, .txt, .rtf etc files and any other printable files to PDF files. During the conversion, you can set page height, page width and other limitations to output PDF file. Please check more information of this software on homepage, in the following part, let us check how to use this software call DocConverter COM from PHP, ASP, C#, VB.NET, ASP.NET applications.

Step 1. Free download Doc Converter COM

  • When downloading finishes, there will be a zip file. Please extract it to some folder then you can check elements in it. There are some elements in the extracted folder: pdfout.dll, install_as_service.bat, install_as_exe.bat, uninstall.bat, and doc2pdf_service.exe.
  • doc2pdf_service.exe is an Windows Service Application,you can call this software from Web Service Applications easily, for example, once you call DocConverter COM from PHP, ASP, C#, VB.NET, ASP.NET applications, doc2pdf_service.exe will accept and execute all conversion tasks automatically. This application will be started by "install_as_exe.bat" and "install_as_service.bat" files.
    There is one example of calling doc2pdf_service.exe software:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    There are two methods to launch this software--"doc2pdf_service.exe" : run as a Windows System Service and run as a Normal Windows Application,
    1. Run As a Normal Windows Application: C:\>doc2pdf_service.exe "-exe"
    This Command Line will run doc2pdf_service.exe as a normal windows application.
    2. Run As a Windows Service: C:\>doc2pdf_service.exe -i
    This Command Line will install the "VeryPDF DocConverter COM Service" into your system.
    C:\>doc2pdf_service.exe -u
    This Command Line will uninstall the "VeryPDF DocConverter COM Service" from your system.
    C:\>net start "VeryPDF DocConverter COM Service"
    C:\>net stop "VeryPDF DocConverter COM Service"
    Above Command Lines will start/stop "VeryPDF DocConverter COM Service" from your system.

Step 2. Converting Office to PDF from web service application.

    • When you need to convert Office to PDF from web service application, please pay more attention to the following things:
      For ASP example:
      1 You need run "install_as_exe.bat" file first, and make sure "doc2pdf_service.exe" application is running,
      2. Please make sure "html2pdf.exe", "doc2pdf_service.exe", "doc2pdf_config.ini" and "pdfout.dll" files have been installed into your system32 folder,
      3. Please make sure you have already installed "PDFcamp Printer" product.
      Here is some code examples for your reference:

~~~~~~~~~~~~~~~~~~~
Set PdfCreator = New PDFOUTLib.PdfCreator
PdfCreator.Word2PDF "C:\sample.doc", "C:\sample.doc.pdf"
PdfCreator.Word2PDF "C:\sample.xls",  "C:\sample.xls.pdf"
PdfCreator.Word2PDF "C:\sample.ppt", "C:\sample.ppt.pdf"
MsgBox "Word2PDF_ShellPrint finished"
Set PdfCreator = Nothing
~~~~~~~~~~~~~~~~~~~

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

DOC to Any Converter

How to insert text file to existing PDF by COM software?

In this article, I will show you how to insert text to PDF by COM software. Meanwhile this method can also be used to append text file to an existing PDF. COM software allows you to run the conversion together with VB, VC, C# etc. The software I will use is VeryDOC Doc Converter COM, by which you can also integrate the corresponding SOFTWARE into your developed software and redistribute it with royalty-free. You have the right to modify and use the SOFTWARE source codes.  Please check more information of this software on homepage. In the following part, let us check how to use this software.

Step 1. Free download Doc Converter COM

  • When downloading finishes, there will be a zip file. Please extract it to some folder then you can use this software.
  • In the extracted package, you will find the following elements:
  • pdfout.dll:This is the DocConverter COM Component, you must register it into your system prior to use the HTML2PDF.exe application, "install_as_exe.bat" and "install_as_service.bat" files will install and register pdfout.dll file into your system automatically.
    install_as_service.bat: It will copy all necessary files to system32 folder and install "doc2pdf_service.exe" as a System Service, the Service Name is "VeryPDF DocConverter COM Service", you can start, stop, restart this Service from Windows System Service Management Application.
    install_as_exe.bat: It will copy all necessary files to system32 folder and install "doc2pdf_service.exe" as a Normal Windows Application.
    uninstall.bat:It will uninstall DocConverter COM from your Windows System.

Step 2. Insert text to PDF by this COM software.

  • When you use this software, please refer to the usage and code templates.
  • Here are some functions code examples, please have a check.
  • When you need to insert "C:/test.txt" file at the first page of an existing PDF file, please refer to the following command line template.
    "html2pdf.exe" "C:/test.txt" "C:/output.pdf" "AutomaticValue=3,Overwrite=yes"
    "html2pdf.exe" "C:/test.doc" "C:/output.pdf" "AutomaticValue=3,Overwrite=yes"
    "html2pdf.exe" "C:/test.html" "C:/output.pdf" "AutomaticValue=3,Overwrite=yes"
  • When you need to append "one text file at the end of PDF file, please refer to the following command line templates:
    "html2pdf.exe" "C:/test.txt" "C:/output.pdf" "AutomaticValue=4,Overwrite=yes"
    "html2pdf.exe" "C:/test.doc" "C:/output.pdf" "AutomaticValue=4,Overwrite=yes"
    "html2pdf.exe" "C:/test.html" "C:/output.pdf" "AutomaticValue=4,Overwrite=yes"
  • By this software, you can specify output PDF file name template by the following command line templates:
  • Set output pdf filename,For Example,Doc2PDFCOM.fileName = "C:/html2pdf.pdf"

  • You can also specify output PDF file paper size like the following output paper formats:
  • Set page type, the value is from 0 to 9,
        0 "Letter [8.5 x 11 in]",
        1 "Legal [8.5 x 14 in]",
        2 "Executive [7.25 x 10.5 in]",
        3 "Ledger [355.6 x 215.9 mm]",
        4 "Tabloid [11 x 17 in]",
        5 "Screen [10 x 7.5 in]",
        6 "A3 [297 x 420 mm]",
        7 "A4 [210 x 297 mm]",
        8 "A5 [148 x 210 mm]",
        9 Custom page size
    For Example,
        Doc2PDFCOM.paperType = 7;

So by those parameters, you can insert text to PDF easily. Please check more functions of this software on user manual. During the using, if you have any question, please contact us as soon as possible.