5 Replies Latest reply: Sep 4, 2014 6:41 AM by MaryKate110 RSS

    convert PDF to XPS

    MaryKate110 Community Member

      I need to convert a large number of documents from PDF format to XPS format.  I can do this with a vb 2013 program which uses  axAcroPDF.LoadFile and axAcroPDF.printAll, printing to an XPS Document Writer printer.  However, this requires the interactive entry of a file name for each document.

       

      Is there a way to automate this, grabbing the name of the PDF document and using it, appending .xps instead of .pdf, for the output document?  If not, do you have a free or inexpensive conversion tool you can suggest, or another approach?

        • 1. Re: convert PDF to XPS
          MichaelKazlow CommunityMVP

          Moved to Acrobat SDK

          • 2. Re: convert PDF to XPS
            lrosenth Adobe Employee

            Why would you want to do this?

             

            PDF is an open international standard (ISO 32000-1:2008) which thousands of supporting applications, hardware, etc. and standardized by over 50 countries around the world!

             

            XPS is a proprietary specification controlled by Microsoft with a VERY limited set of supporting applications.

            • 3. Re: convert PDF to XPS
              Test Screen Name CommunityMVP

              What you want to automate is the XPS driver. That may be possible, but you're asking in the wrong place, it's nothing to do with Adobe.

              • 4. Re: convert PDF to XPS
                KeiWatanabe Community Member

                XPS printer requires every file name to save, I agree it's annoying.

                I think writing WSH script (use Shell.SendKeys) is the most easy way.

                • 5. Re: convert PDF to XPS
                  MaryKate110 Community Member

                  Hi.  Thanks to all of you for replying so quickly.  I apologize for not responding sooner - I got put off onto another project and did not want to respond until I tried your suggestions.  Using SendKeys does work for this, and I am able to bypass the print dialog and put my files to the name I want.

                  However, I also have another problem.

                  Before the print dialog comes up, a warning message is displayed:

                   

                  WARNING!  A script has requested to print an acrobat file.  This could print an entire document.  Do you want to proceed printing?

                   

                  I found information which suggested that this could be suppressed by executing the following code

                  Dim AdobeVersion As Decimal

                  Dim FilePath As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe", "", "")

                     If IO.File.Exists(FilePath) Then

                    AdobeVersion = FileVersionInfo.GetVersionInfo(FilePath).FileMajorPart

                     My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\" & AdobeVersion.ToString("N1") & "\AVAlert\cCheckbox\cAcrobat\", "iWarnScriptPrintAll", "1", Microsoft.Win32.RegistryValueKind.DWord)

                     End If


                  I execute this code before doing my PrintAll statement, and I can see that the code is executed without an error, but I still get the warning.  My version of Adobe Reader is 11.0 and I am running under Windows 7.


                  Any suggestions?  I did try sending an Enter key to try to deal with this message as well but my application hung.