Announcement

Collapse
No announcement yet.

Xprint silently print pdf

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Xprint silently print pdf

    Is there a way when XPRINT is set to send output (attach) to a PDF Driver like PDFCreator to include any parameters like /t which would send the PDF on to the printer silently after it creates the PDF.

    Would it be better to generate the PDF and then use gsprint from another vendor to convert the PDF to Ghostscript and send that to the printer.

    The issue I'm running into is adobe reader (various versions) and acrobat don't always act the same when using the /p or /t option from a shell command inside the pb program.

    Also is there a way to produce an accurate Preview that can be searched. I'm thinking of a Postscript Viewer.

    Any favorites that you have for this functionality. PB 10 has a preview but I don't have the option of using that.

    Bob Mechler

  • #2
    Originally posted by BOB MECHLER View Post
    Is there a way when XPRINT is set to send output (attach) to a PDF Driver...
    CutePDF does that quite nicely. Just select it as your "printer", tell it where you want it to go and give it a file name.
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      Not sure it helps but you could try...

      ShellExecuteEx with a verb of "print." Maybe that "knows" the correct command to print a PDF file for the version of Acrobat currently installed.

      (I am guessing from your comments your PDF 'printer' creates a *.PDF file ???)
      Michael Mattias
      Tal Systems Inc. (retired)
      Racine WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Didn't know CutePDF had that option.
        No harm in trying the "print" option of ShellExecute.

        Thanks,

        Bob Mechler

        Comment


        • #5
          Originally posted by BOB MECHLER View Post
          Didn't know CutePDF had that option.
          Well, it's XPRINT ATTACH CHOOSE.
          There are no atheists in a fox hole or the morning of a math test.
          If my flag offends you, I'll help you pack.

          Comment


          • #6
            Bob.

            I don't know how you would go with licensing and so on but PDFCreator seems to have a lot of the features that you want already built-in.

            The PDFCreator print monitor / configuration program in the Start Menu Group has program settings that include.
            Auto-Save: Configure auto naming options and destination folder.

            Actions: To be performed Before and/or After Saving - especially useful? - Name a script/program to be run including program parameters, eg "<OutputFileName>", the name of the PDF just saved.
            Obviously you can use this feature to launch PB apps that could do just about anything with a newly created PDF

            Print: Print after saving. Optionally 'use default printer without user interaction' and hide progress during printing.

            Profiles: Different confgurations can be 'associated' with different named instances of the PDFCreator Driver. Profiles are exportable for use in different locations..
            Rgds, Dave

            Comment


            • #7
              PDFCreator when combined with Ddoc as the output engine is too slow when printing a large number of documents. We are already doing that combination.

              The end result is to produce as rapidly as we can PDF's that will be archived for later retrieval via a web site. We are already doing this but sometimes 4 or 5 thousand statements take 12-15 hrs to generate.

              Bob

              Comment


              • #8
                I don't see how ddoc is used to create PDFs, unless your "PDF Creator" is treating each page as an "image" (which also makes the PDF files "HUGE")

                You might want to go to a true PDF library for your statement printing and create *.PDF files directly to disk.

                I did this for one client.. we generate 1500 invoices per day to PDF files in about five minutes. We do statements, too but I have no timing available. That's about 6,000 statements per month.

                You could contact my office if you want to talk about 'outsourcing' this.
                Michael Mattias
                Tal Systems Inc. (retired)
                Racine WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Dear PB users,

                  Haru Free PDF Library could be a solution to generate directly a PDF file; I use it in my PB applications:

                  More information on Jose forum:

                  www.jose.it-berater.org/smfforum/index.php?topic=3058.0
                  Jean-Pierre LEROY

                  Comment


                  • #10
                    Thanks for the tip Jean-Pierre. I've followed Haru Free Library and did some tests.

                    Michael is right about why the Ddoc through PDF Creator as the printer driver is slow. It's the bitmap per page thing, instead of a command language like Haru.

                    I've been lobbying to use Haru but the boss needs convincing that it is used by other Powerbasic programmers.

                    In the far distant past I used a program called JustText by William Bailey to create PostScript for the original $7000 Apple LaserWriter. It produced classified ads for newspapers.

                    About 7 years ago I used the HP/GL2 variant of PCL to do some fancy checks, so I should be able to learn Haru. I'll check the link.

                    Just curious, do you know the meaning or derivation of the name LEROY. It's my middle name. You know how some people prefer using their middle name instead of their first name. Well, for some reason kids used to rib me by calling me Leeee-Roy. Since it's French in origin, I can assume it isn't pronounced that way. Probably something like Le Roy with a short e. Sounds better to me than Leeee-Roy.

                    Bob Mechler

                    Comment


                    • #11
                      It may be a corruption of the French Le Roi, meaning The King.

                      It was a popular name amongst the Afro-Caribbean children that I used to teach in South London - their history was one with French influence, so this may be the source.

                      Iain Johnstone
                      “None but those who have experienced them can conceive of the enticements of science” - Mary Shelley

                      Comment


                      • #12
                        I have been using CutePDF for many years, in fact its my default printer. I do some complex formatting and its very fast and produces small files.
                        My son prefers DoPDF.

                        Comment


                        • #13
                          If I understand your original question correctly and you also wish to print a hard copy. If so then as it is a postscript file then after creation you simply get the file and send it to a postscript enabled printer.

                          Comment


                          • #14
                            Bob, If you are using the free cutepad and doing something
                            like this to create your pdf by automating the cutepdf dialog.

                            http://www.powerbasic.com/support/pb...1&postcount=13

                            Try running that exe repeatedly, the dialog will soon hang. At least the similar code to that hangs on my machines.

                            With that code, what if a user is already printing something else from another program or the same program in another instance using cutepdf.


                            Cutepdf is nice, i have it on all my machines, but the free version for automation in programming is not for MCM's Susie Q or Susie Q's relatives working for us.

                            Who knows when CutePDf makers are going to make a change. Haru has not really changed much in many years.

                            Jose Roca's work to make Haru work with PB is very similar to the code of other Haru examples used.

                            Plus if you use it, i would likely learn from your experience with Haru in the future.
                            p purvis

                            Comment


                            • #15
                              I've been lobbying to use Haru but the boss needs convincing that [Haru PDD Library ] is used by other Powerbasic programmers.
                              It's what I used in the application I mentioned in post #8 this thread.

                              But it's not about the programmer, it's about the user. I can probably get the user from that thread to tell you he likes whatever I used. Drop me an email if you need that.

                              [email protected]
                              Michael Mattias
                              Tal Systems Inc. (retired)
                              Racine WI USA
                              [email protected]
                              http://www.talsystems.com

                              Comment


                              • #16
                                I suppose someone should mention, Acrobat has an API, too.

                                AFAIK you need to license the full Acrobat product to get everything you need ; that is, the free viewer does not support API calls.

                                But if you've already licensed (or were looking for an excuse to do so) the full Acrobat product...
                                Michael Mattias
                                Tal Systems Inc. (retired)
                                Racine WI USA
                                [email protected]
                                http://www.talsystems.com

                                Comment


                                • #17
                                  Create a pdf

                                  I do following in my invoice-program:

                                  Code:
                                  'save documentinfos in registry for transfering to pdf-creator
                                  RegDataSet(%HKEY_CURRENT_USER, "SOFTWARE\PdfCreator\Program", "AutosaveDirectory", PdfDir$, %REG_SZ)
                                  RegDataSet(%HKEY_CURRENT_USER, "SOFTWARE\PdfCreator\Program", "AutosaveFilename", PdfFile$, %REG_SZ)
                                  RegDataSet(%HKEY_CURRENT_USER, "SOFTWARE\PdfCreator\Program", "UpdateInterval", "0", %REG_SZ)
                                  RegDataSet(%HKEY_CURRENT_USER, "SOFTWARE\PdfCreator\Program", "OpenOutputFile", "0", %REG_SZ)
                                  RegDataSet(%HKEY_CURRENT_USER, "SOFTWARE\PdfCreator\Program", "UseAutoSave", "1", %REG_SZ)
                                  RegDataSet(%HKEY_CURRENT_USER, "SOFTWARE\PdfCreator\Program", "UseAutoSaveDirectory", "1", %REG_SZ)   
                                  
                                  xprint attach "pdfcreator"
                                  
                                  'now follows your normal printing
                                  xprint
                                  xprint ....
                                  xprint close
                                  
                                  'the pdfFile will be silent created in pdfDir$
                                  
                                  'then I merge the pdfFile with then scanned invoice form with pdftk.exe (pdfToolKit)
                                  
                                  Tem$ = CHR$(34) + PdfPrg$ + CHR$(34) + " " + _
                                         CHR$(34) + PdfDir$ + "\" + PdfFile$ + CHR$(34) + " multibackground " + _
                                         CHR$(34) + PdfDir$ + "\invoice_form.pdf" + CHR$(34) + " output " + _
                                         CHR$(34) + PdfDir$ + "\" + NewPdfFile$ + CHR$(34)
                                  
                                  SHELL Tem$, 1, EXIT TO exitvar&
                                  I tried with Haru Free PDF Library. There I missed some methods for printing such as underline and some other.

                                  You can install pdfcreator as expert without any icon or shortcut, without pdfarchitect, without any toolbar and other unrequested programs. Then you have to integrate pdftoolkit and ready. It works. And both tools are free.
                                  Last edited by Roger Weissberg; 19 Jun 2013, 09:54 AM. Reason: Code Tag inserted

                                  Comment


                                  • #18
                                    I'm just revisiting the fast generation of PDF docs and found this thread from last year. There are some extremely good comments.

                                    I'm leaning toward using Roger Weissberg's approach as my first choice since we have all of our customers installing PDFCreator already

                                    Bob

                                    Comment


                                    • #19
                                      the easy way to do 'background anything' is to run it in its own thread of execution.

                                      Mr. Weissberg's code can easily be ported to do same.
                                      Michael Mattias
                                      Tal Systems Inc. (retired)
                                      Racine WI USA
                                      [email protected]
                                      http://www.talsystems.com

                                      Comment


                                      • #20
                                        If you only want to create text PDF, there is sourcecode here for that.
                                        If you want to create own PDF, or change / manipulate existing ones,
                                        than I recomend debenu quick pdf - for easy tasks you can use the free one (not printing) but If you need more the cost of the dll is less than Acrobat and is well supported (pur DLL or activeX).
                                        Regards,
                                        Hubert

                                        ------------------------------------
                                        http://familie-brandel.de/index_e.html

                                        Comment

                                        Working...
                                        X