question

viralpatel-5130 avatar image
0 Votes"
viralpatel-5130 asked David-9140 Suspended answered

Print using Word Interop

Hi Team,

We are using Word Interop in C# application to print word document.

While word document printing we are getting some alert like "your margines are pretty small, some of your content might be cutt off".

If we ingnore this warning then there will be a possible cutt off in printed TIF Images.

My Question is,
- Can i identify this warning from code like when i print a document then after i wanted to mark that document with a possible cutt off, how can i add this at my code level to identify printing will execute with possible cutt off.

Please advise.

Thanks




office-vba-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
Your problem is related to developer for Word, I changed the tag to office-vba-dev. The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

0 Votes 0 ·

1 Answer

David-9140 avatar image
0 Votes"
David-9140 Suspended answered

Not sure if you can get the warning from code, but you may be interested in printing Word document on a custom paper size.

 using Spire.Doc;
 using System.Drawing.Printing;
    
 namespace PrintWord
 {
     class Program
     {
         static void Main(string[] args)
         {
              //Instantiate a Document object.
             Document doc = new Document();
    
             //Load the document
             doc.LoadFromFile(@"Sample.docx");
    
             //Get the PrintDocument object
             PrintDocument printDoc = doc.PrintDocument;
    
             //Customize the paper size
             printDoc.DefaultPageSettings.PaperSize = new PaperSize("custom", 900, 800);
    
             //Print the document
             printDoc.Print();
    
         }
     }

More information can be found: https://www.e-iceblue.com/Tutorials/NET/Spire.Doc/Program-Guide/Print/C-/VB.NET-How-to-Print-Word-on-a-Custom-Paper-Size.html

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.