PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, September 17, 2022

[FIXED] How to print a document file to a network printer in c#

 September 17, 2022     c#, network-printers, printing     No comments   

Issue

I need to send files (txt, docs etc.) over network using printer driver. I'm able to send raw data to server but not files. I had already tried to Ehsan's Method for printing, but the data inside the document doesn't seems to appear in the document. What I need is a method, or cmd line to print a file over network.


Solution

First, could you please give me a clue which type of file you want to print if it is a text file. it's quite simple you drag two component from the tool box first the printDocument and a printDialog panel and use this link

which is a reference for printDocument and then just simply do this for printing your document:

prindDialog1.document = yourprintDocument;

And everything will go fine.

But, if you want to print something like pdf files you should use a pdfWriter in order to invoke the adobePdf process and print via that.

And the other option is using the PrintPage event of printDocument component which will fire on every page and by using the Graphic library you can Draw everything on each page!



Answered By - Ehsan
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing