Physically printing scanned PDF files to a printer

Marije_Brummel
Member, Moderators Design Patterns Posts: 4,262
Olla,
A few years ago I created a solution to print scanned PDF files to a printer. These are freight documents that should be send along with the invoice.
Back then I used VeryPDF, that allows printing from one script without the PDF reader opening and closing al the time since you might print dozens of documents in batch.
Now I have the same request a few years later and naive me thinks there should be a more nicer way, for example with com or notnet interop.
I tried using the PDFCreator com libraries but it seems that this eventually also just opens the PDF reader, so it does not work as seamless as it should.
Anyone has working solutions that are technically nicer than the script?
Thanks.
A few years ago I created a solution to print scanned PDF files to a printer. These are freight documents that should be send along with the invoice.
Back then I used VeryPDF, that allows printing from one script without the PDF reader opening and closing al the time since you might print dozens of documents in batch.
Now I have the same request a few years later and naive me thinks there should be a more nicer way, for example with com or notnet interop.
I tried using the PDFCreator com libraries but it seems that this eventually also just opens the PDF reader, so it does not work as seamless as it should.
Anyone has working solutions that are technically nicer than the script?
Thanks.
0
Comments
-
Not exactly sure what you are looking for but we use eDocPrinter with embedded commands. One large print job can create multiple emails/pdf files.0
-
No, I mean exactly the other way around.
I have the pdf files, but I want to print them to a normal printer.0 -
viewtopic.php?t=7293
I also found this Form. Can't remember from where?OBJECT Form 50101 Print Any File { OBJECT-PROPERTIES { Date=17.09.08; Time=13:08:22; Modified=Yes; Version List=NLO; } PROPERTIES { Width=7920; Height=1870; } CONTROLS { { 1101101001;TextBox;3630 ;220 ;4070 ;440 ;CaptionML=[ENU=Select a file; NOR=Velg fil]; SourceExpr=PrintThisFile; OnAssistEdit=BEGIN PrintThisFile := CommonDialogMgt.OpenFile(Text001,'',1,'',0); END; } { 1101101002;Label ;220 ;220 ;3300 ;440 ;ParentControl=1101101001 } { 1101101003;CommandButton;1540;990;2200;550;CaptionML=[ENU=Print File; NOR=Skriv ut fil]; OnPush=BEGIN IF ISCLEAR(objShell) THEN CREATE(objShell); IF NOT EXISTS(PrintThisFile) THEN ERROR(Text003,PrintThisFile); SplitDirFile(PrintThisFile,Dir,FileName); objFolder := objShell.NameSpace(Dir); objFolderItems := objFolder.Items; objFolderItem := objFolderItems.Item(FileName); objFolderItem.InvokeVerb('PRINT'); objVerbs := objFolderItem.Verbs; CurrForm.CLOSE; END; } { 1101101005;CommandButton;3960;990;2200;550;PushAction=Close } } CODE { VAR CommonDialogMgt@1101101002 : Codeunit 412; PrintThisFile@1101101013 : Text[250]; Dir@1101101010 : Text[250]; FileName@1101101012 : Text[250]; objShell@1101101001 : Automation "{50A7E9B0-70EF-11D1-B75A-00A0C90564FE} 1.0:{13709620-C279-11CE-A49E-444553540000}:'Microsoft Shell Controls And Automation'.Shell"; Text001@1101101003 : TextConst 'ENU=Select a file...;NOR=Velg fil...'; Text002@1101101004 : TextConst 'ENU=Could not print file %1.\Make sure you use a file extension you can print from Windows Explorer.;NOR=Kunne ikke skrive ut fil %1.\Det er kun mulig † skrive ut filtyper som kan skrives ut fra Windows Explorer.'; objFolder@1101101005 : Automation "{50A7E9B0-70EF-11D1-B75A-00A0C90564FE} 1.0:{BBCBDE60-C3FF-11CE-8350-444553540000}:'Microsoft Shell Controls And Automation'.Folder"; objFolderItems@1101101006 : Automation "{50A7E9B0-70EF-11D1-B75A-00A0C90564FE} 1.0:{744129E0-CBE5-11CE-8350-444553540000}:'Microsoft Shell Controls And Automation'.FolderItems"; objFolderItem@1101101007 : Automation "{50A7E9B0-70EF-11D1-B75A-00A0C90564FE} 1.0:{FAC32C80-CBE4-11CE-8350-444553540000}:'Microsoft Shell Controls And Automation'.FolderItem"; objVerbs@1101101009 : Automation "{50A7E9B0-70EF-11D1-B75A-00A0C90564FE} 1.0:{1F8352C0-50B0-11CF-960C-0080C7F4EE85}:'Microsoft Shell Controls And Automation'.FolderItemVerbs"; i@1101101008 : Integer; Text003@1101101000 : TextConst 'ENU=Couldn''t find the file %1.\Please check that the path and filename is correct.;NOR=Fant ikke filen %1.\Vennligst sjekk at filstien og filnavnet er riktig.'; Text004@1101101014 : TextConst 'ENU=PROPERTIES;NOR=EGENSKAPER'; Text005@1101101015 : TextConst 'ENU=OPEN;NOR=PNE'; PROCEDURE SplitDirFile@1101101000(FullString@1101101000 : Text[250];VAR JustDir@1101101001 : Text[250];VAR JustFileName@1101101002 : Text[250]); VAR ExitLoop@1101101003 : Boolean; PointBreak@1101101004 : Integer; BEGIN ExitLoop := FALSE; PointBreak := STRLEN(FullString); WHILE (NOT ExitLoop) OR (PointBreak <= 1) DO IF COPYSTR(FullString,PointBreak,1) = '\' THEN BEGIN JustFileName := COPYSTR(FullString,PointBreak + 1); ExitLoop := TRUE; END ELSE PointBreak -= 1; JustDir := COPYSTR(FullString,1,PointBreak); END; BEGIN END. } }
0 -
Thanks. But I know that you can use scripting, I was hoping for a more sophisticated way like Com/DotNet.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions