Words Object Printing Issue

Hello,
Please help with the issue below. I need my Aspose object to use the print setting object provided but it looks like its not using what is provided. I am not sure what the issue is. When I print same with MSWord it does print 1-16 pages with duplex. Aspose is printing all the pages and non duplex.
Any ideas ?

mobjMainAsposeDoc.Open("XYZ.Doc")
Dim lPrintSettings As New System.Drawing.Printing.PrinterSettings
Dim lPaperSize As New System.Drawing.Printing.PaperSize
lPrintSettings.Duplex = True
lPrintSettings.Copies = 1
lPrintSettings.FromPage = 1
lPrintSettings.ToPage = 16
'lPrintSettings.DefaultPageSettings.PaperSize =lPaperSize.
mobjMainAsposeDoc.Print(lPrintSettings)

I do have the page size and everything setup correct and I am actually printing the document created by aspose. Which also shows correct mirror margin in MSWord.

Hi
Thanks for your request. Actually, PrinterSettings.Duplex is not Boolean. I used the following code for testing and all works fine:

Document doc = new Document(@"Test158\in.doc");
PrinterSettings settings = new PrinterSettings();
settings.PrinterName = @"\\192.168.134.10\hp LaserJet 1010 Series Driver";
settings.Duplex = Duplex.Horizontal;
doc.Print(settings);

Best regards.

Thanks for the post !!!
I did make this to work with Duplex.Vertical / Duplex.Horizontal but it is not actually printing the mirror margin. When I print same document thru MSword it prints correct mirror margins. I have special code that does this mirror margin and is visible in correct format thru MSword. I am not sure if there is any special setting that I need to follow for aspose object.
Here is my code which sets mirror margin.

For Each lsection As Aspose.Words.Section In mobjMainAsposeDoc.Sections
lsection.PageSetup.MirrorMargins = True 
lsection.PageSetup.LeftMargin = miLeftMargin
lsection.PageSetup.RightMargin = miRightMargin
lsection.PageSetup.TopMargin = miTopMargin
lsection.PageSetup.BottomMargin = miBottomMargin
Next

Please update.
Thanks,
Vinay Hattarki

Hi
Thanks for your request. Unfortunately, mirror margins are not supported in our rendering engine. I created new issue #7494 in our defect database, regarding this problem. I will notify you as soon as it is fixed.
Best regards.

I save mObjMain of type Aspose.Words.Document as .Doc file. I see that MSWord does show the mirror margin. I also see that MSWord does print Mirror Margin which is actually created by Aspose.Words.
When you say mirror margin is not supported, does that mean I will never be able to print mirror margin with appropriate settings(lprintersettings)??
mObjMain .Print(lprintersettings)
I was told earlier that if I have sections coded to see mirror margin then it should atleast print thru code line --> mObjMain .Print(lprintersettings) does not matter if Editor shows it or not.
Please let me know.
Thanks

Hi
Thanks for your request. I said that mirror margins are not yet supported in our Rendering Engine. Document printing works through this engine, so mirror margins does not work when you print your document using Document.Print method.
Best regards.

Thanks for the update!!!
Once I append the various docuemnts in mobjMainAsposeDoc object I use the method below to Mirror Margin. Is there any way to interogate the pages while this loop is in process. I have tried using mobjMainAsposeDoc.Document.UpdatePageLayout() method and get the page count but it takes lot of time.

Private Sub AsposeMirrorMargin()
For Each lsection As Aspose.Words.Section In mobjMainAsposeDoc.Sections
lsection.PageSetup.MirrorMargins = True
lsection.PageSetup.LeftMargin = miLeftMargin
lsection.PageSetup.RightMargin = miRightMargin
lsection.PageSetup.TopMargin = miTopMargin
lsection.PageSetup.BottomMargin = miBottomMargin
Next
End Sub

If there is any way that tells me which page I am on while in this loopr on any way to know lsection variable belongs to X(3rd) no page would be nice.
With this I was trying to see if I can condition the assignemnt of Left and Right Margin and swap it on page no.
Please let me know
Thanks,
Vinay Hattarki

Hi
Thanks for your request. No, unfortunately, you cannot iterate through pages in the document and there is no way to determine current page number.
In addition, it is impossible to specify different margins for each page within single Section.
Best regards.

Mirror Margin feature is extremly important in my development. Is there any workaround to get the Printing work with Mirror Margin ???
Can we save this doc as PDF and can the PDF version be made mirror margin ? I am just wondering ASPOSE has such wonderful set of tools and it does save the document in Mirror Margin, why is it not printing !!! :frowning:
We are at final stage where need to decide on this product to buy .
Any help appreciated !!!
Thanks,
Vinay Hattarki

Hi
Thanks for your inquiry. Unfortunately, there is no workaround. You should wait while we implement this feature in our Rendering Engine. Sorry for inconvenience.
Best regards.

The issues you have found earlier (filed as 7494) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(78)