@VeryDOC SDK & COM & CLI

Print PDF to XPS and back to PDF via PowerShell

Print PDF to XPS back to PDF via PowerShell

With the help of another member on here, I was able to make two scripts: one converts a PDF to XPS and the other XPS to PDF using a workflow. When combining them into one script, the first workflow converts the file to XPS, however, the second workflow doesn't seem to work at the appropriate time or at all. There are some cleanup items at the end of the second workflow that do seem to be working properly. Can I delay the start of the second workflow somehow to start at the appropriate time? Thanks in advanced! The other question can be found here Print PDF to XPS using PowerShell.

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

Print PDF to XPS and back to PDF via PowerShell
This can be done easily, you can use VeryDOC XPS to PDF Converter Command Line to convert from XPS file to PDF file, and then use VeryDOC PDF to Vector Converter Command Line to convert from PDF file back to XPS format, you can convert from XPS to PDF and PDF to XPS from command line, you can also call them from a script to do the batch conversion.

XPS to PDF Converter Command Line,
https://www.verydoc.com/xps-to-pdf.html
https://www.verydoc.com/xps2pdf.zip

after you download it, you can run following command lines to batch convert your XPS files to PDF files,

xps2pdf.exe C:\in.xps C:\out.pdf
xps2pdf.exe C:\in\*.xps C:\out\*.pdf

PDF to Vector Converter Command Line,
https://www.verydoc.com/pdf-to-vector.html
https://www.verydoc.com/pdf2vec_cmd.zip

after you download it, you can run following command lines to batch convert from PDF files to XPS files,

pdf2vec.exe C:\in.pdf C:\out.xps
for /r D:\test %F in (*.xps) do "pdf2vec.exe" "%F" "%~dpnF.xps"
for %F IN (D:\test\*.xps) DO "pdf2vec.exe" "%F" "%~dpnF.xps"

VeryDOC

PDF to Vector Converter, XPS to PDF and Image Converter

How to Convert from XPS to PDF format and Convert from PDF to XPS format again?

  1. How to convert XPS to PDF from a Windows GUI application?
  2. How to automatically convert XPS to PDF from command line?
  3. How to batch convert XPS to PDF?
  4. How to convert XPS to PDF with a script?
  5. How to convert XPS to PDF from your own software?
  6. How to print XPS to PDF?
  7. How to print the XPS file to Any Windows Printer from Command Line or SDK?
  8. How to convert from PDF file back to XPS?

Both XPS (XML Paper Specification XPS, Open XML Paper Specification, OXPS) and PDF (Portable Document Format) formats are used to produce and share finalized documents: resumes, newsletters, invoices, legal documents, financial reports, tax returns and other types of documents. XPS (OXPS) format was meant to replace PDF as a universal standard for documents, but as for now PDF seems to have won this digital war.

How to Convert from XPS to PDF format and Convert from PDF to XPS format again?

Though both formats have pretty much the same functionality, XPS format, compared to PDF, seems to be almost dead in the water. If your colleague or friend receives an XPS file from you, they might find it difficult to open or even consider it as malware.

It is possible to convert XPS to PDF in a variety of ways: using offline desktop applications (manually, automatically or in batch mode), using command line interface (CLI), a virtual printer or a script file.

1. How to convert XPS to PDF from a Windows GUI application?

You can use VeryPDF XPS to Any Converter GUI to batch convert from XPS files to PDF files on your Windows system, XPS to Any Converter GUI is an offline desktop GUI application, you can use it to convert from XPS files to PDF files manually,

http://www.verypdf.com/app/xps-to-any-converter/index.html
http://www.verypdf.com/app/xps-to-any-converter/try-and-buy.html#buy
http://www.verypdf.com/dl2.php/verypdf-xps-to-any.exe

2. How to automatically convert XPS to PDF from command line?

You can use "VeryPDF XPS to Any Converter Command Line" or "VeryDOC XPS to PDF Converter Command Line" to batch convert from XPS files to PDF files from command line,

http://www.verypdf.com/app/xps-to-any-converter/try-and-buy.html#buy_cmd
https://www.verydoc.com/xps2pdf.zip

https://www.verydoc.com/xps-to-pdf.html
https://www.verydoc.com/xps2pdf.zip

3. How to batch convert XPS to PDF?

You can use xps2pdf.exe to batch convert all XPS files in a folder and its sub-folders to PDF files with one command line easily, for example,

xps2pdf.exe C:\in.xps C:\out.pdf
xps2pdf.exe C:\in\*.xps C:\out\*.pdf
xps2pdf.exe -producer "Test Producer" -creator "Test Creator" -subject "Test Subject" C:\in.xps C:\out.pdf
xps2pdf.exe -linearize C:\in.xps C:\out.pdf
xps2pdf.exe -ownerpwd 123 -keylen 2 -permission 128 C:\in.xps C:\out.pdf
for /r D:\test %F in (*.xps) do "xps2pdf.exe" "%F" "%~dpnF.pdf"
for %F IN (D:\test\*.xps) DO "xps2pdf.exe" "%F" "%~dpnF.pdf"

4. How to convert XPS to PDF with a script?

You can call "VeryPDF XPS to Any Converter Command Line (xps2pdf.exe)" or "VeryDOC XPS to PDF Converter Command Line (xps2pdf.exe)" from your script or your own software to batch convert from XPS files to PDF files easily.

Command line interface lets system administrators and advanced users can take xps2pdf.exe into use and adapt it to their company's IT structure. For example, you can call xps2pdf.exe from the Windows Task Scheduler, from a batch, cmd or VBScript file. This allows to have your XPS documents changed to PDF without your presence - conversion will be scripted and/or scheduled.

5. How to convert XPS to PDF from your own software?

You can add commands related to xps2pdf.exe into the source code of the software you are developing or your own existing software. Here's an example set of commands written in C# which can be built into your programming code:

public void convert()
{
    string converterPath = @"D:\\VeryDOC\\xps2pdf.exe";
    string procArguments = "D:\\in.xps D:\\out.pdf";
    Process process = new Process();
    process.StartInfo.UseShellExecute = true;
    process.StartInfo.CreateNoWindow = true;
    process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
    // ProcessWindowStyle.Hidden;
    process.StartInfo.FileName = converterPath;
    process.StartInfo.Arguments = procArguments;
    process.Start();
    process.WaitForExit();
    process.Close();
    process.Dispose();
}

If you are prefer to use a SDK/DLL to instead of Command Line application, VeryDOC is also provide a XPS to PDF Converter SDK version, please feel free to contact us to require a demo version of this XPS to PDF Converter SDK product,

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

6. How to print XPS to PDF?

A simple way to convert XPS files is using a virtual printer instead of using a converter to PDF. If you don't have any virtual printer installed yet, try using VeryPDF Document Converter (docPrint Pro). It can save your XPS to PDF, which can be later printed on a regular printer, if necessary. VeryPDF Document Converter (docPrint Pro) can also save your XPS file as an image file - BMP, DCX, GIF, JPEG, PCX, PNG or TIFF.

The instruction below lets you converting files one by one, however, you can also set up batch conversion to PDF to process multiple files pretty fast.

Instruction:
Download and install VeryPDF Document Converter (docPrint Pro) from this web page first.

http://www.verypdf.com/app/document-converter/try-and-buy.html#buy_pro
http://www.verypdf.com/artprint/docprint_pro_setup.exe

* Open an XPS file you want to convert to PDF.
* Click "File" > "Print".
* Select docPrint or docPrint PDF Driver as printer and click "Print", you will able to save to PDF file easily.

7. How to print the XPS file to Any Windows Printer from Command Line or SDK?

If you wish integrate a XPS printing function into your system, you can test with PDFPrint Command Line or PDFPrint SDK product, you may download them from this web page,

http://www.verypdf.com/app/pdf-print-cmd/try-and-buy.html#buy
http://www.verypdf.com/pdfprint/pdfprint_cmd.zip
http://www.verypdf.com/pdfprint/pdfprint_sdk.zip

Please look at following web page for more information about printing function in both PDFPrint Command Line and PDFPrint SDK products,

[VeryPDF Release Notes] VeryPDF Released PDFPrint Command Line v7.0 today, the new version supports batch print XPS files to physical and virtual printers and PDF, PCL, PS, EPS, TIFF, JPG, PNG, XPS, EMF, WMF etc. formats,
http://www.verypdf.com/wordpress/201804/verypdf-release-notes-verypdf-released-pdfprint-command-line-v7-0-today-the-new-version-supports-batch-print-xps-files-to-physical-and-virtual-printers-and-pdf-pcl-ps-eps-tiff-jpg-png-xps-e-43798.html

8. How to convert from PDF file back to XPS?

How to Convert from XPS to PDF format and Convert from PDF to XPS format again?

You can use VeryDOC PDF to Vector Converter Command Line or PDF to Vector Converter SDK to convert from PDF files to XPS files, you may download VeryDOC PDF to Vector Converter Command Line or PDF to Vector Converter SDK from this web page to try,

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

after you download PDF to Vector Converter Command Line software, you can run following command lines to batch convert from PDF files to XPS and other formats,

pdf2vec.exe C:\in.pdf C:\out.emf
pdf2vec.exe C:\in.pdf C:\out.wmf
pdf2vec.exe C:\in.pdf C:\out.ps
pdf2vec.exe C:\in.pdf C:\out.eps
pdf2vec.exe C:\in.pdf C:\out.svg
pdf2vec.exe C:\in.pdf C:\out.swf
pdf2vec.exe C:\in.pdf C:\out.xps
pdf2vec.exe C:\in.pdf C:\out.hpgl
pdf2vec.exe C:\in.pdf C:\out.plt
pdf2vec.exe C:\in.pdf C:\out.pcl

How to Convert from XPS to PDF format and Convert from PDF to XPS format again?

Questions?
Should you have any questions or issues related to converting from XPS to PDF or vice versa, please don't hesitate to contact us. Or if you know some tips or other ways we didn't mention here, please let us know (http://support.verypdf.com/open.php )! We will update this article.

PDF to PDF/A Converter

PDF document properties field problem and description of modes with PDF to PDF/A Converter Command Line software

Hello! Your PDF to PDF/A Converter Tool works well but we have one problem with PDF-Fields (author, producer, creator, subject). We have tried to use these parameters but the edited PDF has no data in these fields!

We ask to help!

Thank you in advance.
Customer
------------------------------------

PDF document properties field problem and description of modes with PDF to PDF/A Converter Command Line software
Thanks for your message, you can use following options to set author, producer, creator, subject options into PDF file,

-producer <string> : Set 'producer' to PDF file
-creator <string> : Set 'creator' to PDF file
-subject <string> : Set 'subject' to PDF file
-title <string> : Set 'title' to PDF file
-author <string> : Set 'author' to PDF file
-keywords <string> : Set 'keywords' to PDF file

VeryDOC
------------------------------------
Hello! Please describe all available modes for your wonderful tool! We haven't found any description of Option -mode

Thank you!
Customer
------------------------------------
Thanks for your message, pdf2pdfa.exe supports following modes,

pdf2pdfa.exe -mode 0 C:\in.pdf C:\pdfa-out.pdf
pdf2pdfa.exe -mode 1 C:\in.pdf C:\pdfa-out.pdf
pdf2pdfa.exe -mode 2 C:\in.pdf C:\pdfa-out.pdf
pdf2pdfa.exe -mode 22 C:\in.pdf C:\pdfa-out.pdf
pdf2pdfa.exe -mode 4 C:\in.pdf C:\pdfa-out.pdf

In general, "-mode 2" works best, you can always use "-mode 2" option to convert all of your PDF files to PDF/A files.

VeryDOC
------------------------------------
Here is the detailed command line options for PDF to PDF/A Converter Command Line v2.0 software,

PDF to PDF/A Converter Command Line v2.0
http://www.verypdf.com
https://www.verydoc.com
Email: support@verydoc.com
Release Date: Oct 13 2015
Usage: pdftools [options] <pdf-file> [<out-pdf>]
  -cl <int>           : set color space, 0 is RGB, 1 is CMYK, 2 is grayscale
      -cl 0 : use RGB  ICC profile for device-specific color spaces
      -cl 1 : use CMYK ICC profile for device-specific color spaces
      -cl 2 : use GRAY ICC profile for device-specific color spaces
  -quick              : convert PDF to PDF/A by quick mode, same as "-mode 1"
  -mode <int>         : convert PDF to PDF/A by various modes, e.g, 0, 1, 2, 22, 4, etc.
  -skip               : don't overwrite an output file if it already exists
  -producer <string>  : Set 'producer' to PDF file
  -creator <string>   : Set 'creator' to PDF file
  -subject <string>   : Set 'subject' to PDF file
  -title <string>     : Set 'title' to PDF file
  -author <string>    : Set 'author' to PDF file
  -keywords <string>  : Set 'keywords' to PDF file
  -startpage <int>    : Set the current page when open the file
  -openaction <string>: Set OpenAction to PDF file
      OpenAction includes "FitBH", "FitH", "Fit", etc., for example:
      -openaction "FitBH" or -openaction "50"
      -openaction "50" means display pages with magnification=50%.
  -reset              : Reset all PDF/A configuration files
  -repair             : Repair damaged PDF file automatically
  -$ <string>         : input registration key
Examples:
   pdf2pdfa.exe C:\in.pdf C:\out.pdf
   pdf2pdfa.exe C:\in\*.pdf C:\out\*.pdf
   pdf2pdfa.exe -producer myproducer -creator mycreator C:\in.pdf C:\out.pdf
   pdf2pdfa.exe -startpage 2 C:\in.pdf C:\out.pdf
   pdf2pdfa.exe -startpage 2 -openaction 100 C:\in.pdf C:\out.pdf
   pdf2pdfa.exe -reset C:\in.pdf C:\out.pdf
   pdf2pdfa.exe -quick C:\in.pdf C:\out.pdf
   pdf2pdfa.exe -mode 0 C:\in.pdf C:\pdfa-out.pdf
   pdf2pdfa.exe -mode 1 C:\in.pdf C:\pdfa-out.pdf
   pdf2pdfa.exe -mode 2 C:\in.pdf C:\pdfa-out.pdf
   pdf2pdfa.exe -mode 22 C:\in.pdf C:\pdfa-out.pdf
   pdf2pdfa.exe -mode 4 C:\in.pdf C:\pdfa-out.pdf

PDF to PDF/A Converter Command Line home page,

https://www.verydoc.com/pdf-to-pdfa.html
https://www.verydoc.com/pdf2pdfa_cmd.zip

DWG to Image Converter

DWG to Image Command Line can not trim white margins from generated image files, DWG to JPG and PNG Converter

We've ordered the "DWG to Image Command Line End User License" software.

DWG to Image Command Line can not trim white margins from generated image files, DWG to JPG and PNG Converter

Now, we used the V3.2 program from your company website, and it can be run with the series number!

https://www.verydoc.com/dwg-to-image.html
https://www.verydoc.com/verydoc_dwg2image_cmd.zip

* We used version currently as below for your reference:*
DWGTools Converter Command Line v3.2
Convert DWG and DXF files to Raster BMP, JPG, PNG, TIFF, GIF formats.
Release Date: Nov  7 2016
Operating system: Windows 10 64bit

Although the program can running with serial number, we have some problem, please help us to check it.

(1) use "-debug" parameter:
Conversion fail, why is no any extra debugging information?!

(2) use "-dpi" parameter:
If we use the "-dpi" parameter, the conversion file has a lot of blank areas above and below (please see the attachment); and if we don't use the "-dpi" parameter, it automatically removes the blank. Is there any parameter that we can solve the blank space problem?!

(3) use "zoomtype" parameter:
We think to use "zoomtype 2 (Zoom Extents) parameter, It should be possible to remove the white space, but in fact, this parameter has no effect. Do you have any suggestion for that?!

(4) Could you please inform us which version program is running stability and suitable for us to use?!

Thanks for your assistance!

Best regards,
Customer
---------------------------------------------------------------------
Thanks for your message, here are answers to your questions,

1. Conversion fail, why is no any extra debugging information?

In general, the conversion fail may caused by high DPI value, the high DPI resolution will generate very big width and height values, such as an image file with 50000x50000 pixel or more dimension, if your system hasn't enough memory, it will show "Conversion fail" error message, in this case, you may reduce the DPI value to try again, e.g., "-dpi 10" or "-dpi 20",

dwg2img.exe -bgcolor 255 -dpi 20 test3.dwg _test3.png

btw, if you wish to remove highlight colors from PNG image file, you can run following command line to convert from color PNG image file to black and white image file,

imgconv.exe -threshold 98% _test3-trim.png _test3-bw.png

after you run above command line to process your image file, you will get a trimmed image file automatically.

2. In order to remove blank space from generated image files, you can use imgconv.exe application, imgconv.exe is included in the "verydoc_dwg2image_cmd.zip" package, you can run following command line to trim white margins from your PNG image files easily,

imgconv.exe -trim -border 50 -bordercolor white _test3.png _test3-trim.png

3. "zoomtype" parameter is just zoom DWG content to fit the paper size, it can't remove the margins, if you need to remove the margins, you need use imgconv.exe application.

4. You can always download the latest version from our website directly,

https://www.verydoc.com/dwg-to-image.html
https://www.verydoc.com/verydoc_dwg2image_cmd.zip

VeryDOC
---------------------------------------------------------------------

School How to convert your image to vector PDF, DXF, SVG formats (png to svg, jpg to svg, png to dxf, jpg to dxf, etc.)?

http://www.verypdf.com/raster-to-vector/online-raster-to-vector.html

DWG to Image Command Line can not trim white margins from generated image files, DWG to JPG and PNG Converter

VeryDOC has a Scan2CAD software also, with this Scan2CAD software, you can convert your images, such as PDF files, or BMP, or any other image, into a clean, editable Vector file, such as DXF, PDF, SVG, etc. formats.

Just open following web page in your web browser,

http://www.verypdf.com/raster-to-vector/online-raster-to-vector.html

DWG to Image Command Line can not trim white margins from generated image files, DWG to JPG and PNG Converter

Click on "Choose File" button to choose an architectural image, choose "Output Format" with PDF, SVG or DXF format, and choose some other options, after that, please click "Upload and Convert File" button, you will upload the raster image file to our server, our "Cloud Raster to Vector Converter" will convert this raster image file to vector DXF, PDF, SVG, etc. formats, you can download and save the converted vector file to your local system properly.

@VeryDOC SDK & COM & CLI

How to intercept a print job, convert it to PDF file or plain text file or image file and then forward the print job to another printer?

We have some customers who often ask us about how to intercept and capture the print jobs from Windows printer, save them to PDF or text or image files and then continue the printing, yes, this is a good question, VeryPDF docPrint Pro is a good software to implement this function, it can capture all print jobs, save them to various document formats, and then execute the printing continue.

docPrint Pro v8.0 can be downloaded from this web page,

http://www.verypdf.com/app/document-converter/document-converter.html
http://www.verypdf.com/app/document-converter/try-and-buy.html#buy_pro
http://www.verypdf.com/artprint/docprint_pro_setup.exe

Here is the release note for the docPrint Pro v8.0 software,

http://www.verypdf.com/wordpress/201804/verypdf-release-notes-verypdf-released-docprint-pro-v8-0-today-docprint-pro-v8-0-is-able-to-make-a-connection-between-docprint-and-other-windows-printers-43787.html

Here are some questions from our customers, just for your reference,

-------------------------------------------------------------------
I wish to intercept print jobs, read who they are from etc., and then only print them, if the program wants to.

Is there any documents or samples on doing such a thing, if so can some one point me to them, or give me a sample below?

Something on the pc prints (e.g. notepad), the program intercepts the print job (it does not get printed), if the program determines if the print job is worthy of being printed, then it will be printed.

Currently I'm using system.printing, to collect all the printers and find new print jobs,
pause them if they are new, read information about them, e.g. pages, paper size (have not figured out paper size yet), if they are to be printed, un-pause them, else cancel them.

This is not the best way, as i have to make the program auto close the print job window, if it is opened. Because un-pausing a print job, even for part of a second, lets the whole print job get to the printer.

Customer A
-------------------------------------------------------------------
How to Intercept Printer Data?

Could anybody tell me how can I create a small driver to intercept and capture information being sent to the printer and instead write it to a file?

Thanks.
Customer B
-------------------------------------------------------------------
I need to intercept a print order from a program like Core, Photoshop or Word and capture a series of data from it just like the print date, dimensions of impression etc. to save in a database and then release it to print.

Customer C
-------------------------------------------------------------------
Is there any way to intercept print jobs on network or local printer

Is there a way to monitor the print queue (before it gets to the print queue) and make sure that a particular user is only printing specified number of copy of a document? I want to find out how many copies of printout particular user had taken to maintain a record of this. How can I do that using Java Code or any other programing language?

Thanks In Advance...
Customer D
-------------------------------------------------------------------
How capture printer data before print, parsing and edit the data then send it to printer?

Any C# sample would be great.

I'm looking for source code or sample that get printer data before print (capture printer output) put it in variable and change some values then print it in form.

Any idea how to get data and put it into variable for special purpose?

Customer E
-------------------------------------------------------------------
How Do I Intercept Data Sent From A Printer Attached To Retail POS In A Store?

Hello,

Please I need help from experts familiar with printer technology, I'm designing a loyalty solution that will capture transactions performed in a retail store, I'd like to fetch the records of the items and amount sent to the printer for receipt printing. Is there a way I can intercept that data and store in a location for later collation?

Appreciate any ideas on this.
Customer F
-------------------------------------------------------------------
How to intercept a print job convert it to plain text and print?

Dear Experts,

I need some advice and tips for a new project i want to start.

I will be working with several bars and restaurants for a loyalty program.

Since all the customers already have a POS Software/Hardware from different vendors, i need to write a program to be able to capture in plain text the final invoice when the POS prints the final receipt.

The process should be something like:

1. The user send the command to the POS software to print the final check
2. The program will intercept the printing job, and create a plain text file and store it into the local PC.
3. The check is printed automatically
4. This should be done in silent mode, the user should not notice anything different.

My questions are:

1. Is this possible to do with POS printers like the ESPONS TM family printers?
2. First I want to build this for Windows XP to Windows 8.
3. Which programming language is more suitable for this task? I can use C# and Delphi.

I will give the max point available!!!

Thanks Experts!
Customer G
-------------------------------------------------------------------

VeryPDF docPrint Pro v8.0 has a printing capture and forwarding function, please by following steps to use this function,

1. Please download and install docPrint Pro v8.0 from this web page,

http://www.verypdf.com/app/document-converter/try-and-buy.html#buy_pro
http://www.verypdf.com/artprint/docprint_pro_setup.exe

2. If you are using 64bit Windows system, your default installation folder will be "C:\Program Files (x86)\docPrint Pro v8.0", you will see the files in this folder after you install it,

3. After you install the docPrint Pro v8.0 software, you can run following command line to connect docPrint and another printer together,

"C:\Program Files (x86)\docPrint Pro v8.0\artprint.exe" -forwardprinter

How to intercept a print job, convert it to PDF file or plain text file or image file and then forward the print job to another printer?

You will see following setting dialog for Printer Redirection,

How to intercept a print job, convert it to PDF file or plain text file or image file and then forward the print job to another printer?

You can select a target printer (forwarded printer) first, for example, you can choose "Microsoft XPS Document Writer" for test purpose, if you print documents to docPrint, docPrint will forward the print jobs to "Microsoft XPS Document Writer", you will get XPS files automatically.

If you want to get the PDF and Text files for each captured print job, you need to check "Save document as PDF" and "Extract to text files" two options.

OK, You can click "Save & Close" button to close this dialog.

4. Now, you can run MS Word application or other applications for printing purpose, you can open a Word document in MS Word application, print it to docPrint virtual printer, you will get a PDF file and a plain text file in predefined folder and also get a XPS file automatically.

How to intercept a print job, convert it to PDF file or plain text file or image file and then forward the print job to another printer?

This is the printing captured PDF document, the filename is "20180415113535_4_Microsoft Word - Original Filename.pdf", this PDF file looks fine,

How to intercept a print job, convert it to PDF file or plain text file or image file and then forward the print job to another printer?

You will also get a text file in the same folder, the text filename is "20180415113535_4_Microsoft Word - Original Filename.txt", this text file has same layout with original Word document and PDF file.

5. Everything is fine now.

We suggest you may download the trial version of docPrint Pro v8.0 to try, if you encounter any problem with it, please feel free to let us know, we are glad to assist you asap.