Printing Existing PDF file

wdheem
Member Posts: 7
Hello Experts! 
The below is the code to print an existing PDF...
An Below Variables are used
I embedded this code in the page action (to print). However, this code does not work. Meaning, that PDF reader(adobe) does not open and the document does not print. I would appreciate if anyone could help on this issue.

The below is the code to print an existing PDF...
shellProcess:=shellProcess.Process(); shellProcess.StartInfo.FileName:='D:\Test\Test.pdf'; shellProcess.StartInfo.CreateNoWindow:= TRUE; shellProcess.StartInfo.WindowStyle:= windowStyles.Hidden; shellProcess.StartInfo.Verb:= 'print'; shellProcess.Start();
An Below Variables are used
[b]shellProcess [/b]DotNet System.Diagnostics.Process.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' [b]windowStyles [/b]DotNet System.Diagnostics.ProcessWindowStyle.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
I embedded this code in the page action (to print). However, this code does not work. Meaning, that PDF reader(adobe) does not open and the document does not print. I would appreciate if anyone could help on this issue.
0
Comments
-
-
Your DotNet variables do not seem to be declared as Running On Client. This means your code will look for the file
\Test\Test.pdf on the server.
My guess is the file is located on the client.Brian Rocatis
Senior NAV Developer
Elbek & Vejrup1 -
Thankyou!! rocatis! It works!0
-
windowStyles.Hidden isn't available at my pc. any idea?
0 -
Dear mdPartnerNL!
To get widowsStyles.Hidden property first you have to declare a Dotnet variable that refers [System.Diagnostics.ProcessWindowStyle.... The following are the steps:-
1. Create a DotNet Variable e.g. windowStyles
2. Click the Assist Edit button in sub type
3. Find System from the .net Assembely
4. Select System.Diagnostics.ProcessWindowStyle
If you mean System.Diagnostics.ProcessWindowStyle is not available in your PC, I guess it could be a problem in your .net Framework.0 -
Dear mdPartnerNL!
To get widowsStyles.Hidden property first you have to declare a Dotnet variable that refers [System.Diagnostics.ProcessWindowStyle.... The following are the steps:-
1. Create a DotNet Variable e.g. windowStyles
2. Click the Assist Edit button in sub type
3. Find System from the .net Assembely
4. Select System.Diagnostics.ProcessWindowStyle
If you mean System.Diagnostics.ProcessWindowStyle is not available in your PC, I guess it could be a problem in your .net Framework.
That's what I did, I don't have the .Hidden:
'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.ProcessWindowStyle
IM using 2009, maybe that is the clue?
0 -
In the center column, click Properties and eyeball that list? You're only looking at Methods in the above screenshot.JEREMY VYSKA
CEO, Spare Brained Ideas, Göteborg, Sweden
New (April 2021) Getting Started with Microsoft Dynamics 365 Business Central Book Available: "Your First 20 Hours with Business Central"1
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