[Version 3.01]Trying to print A3 landscape

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
pmeems
Posts: 11
Joined: Mon Jul 23 2007
Location: The Netherlands

[Version 3.01]Trying to print A3 landscape

Post by pmeems »

I've finally got it working to print a Word document without all the pop-ups. I need this because I'm gonna use the app as a windows service.
I need to print 5 different documents. 4 of them are A4 portrait and these are going OK. But the last one is A3 landscape and Amyuni is printing it as A4 portrait.
I've search this forum and I stumbled on the setPaperSize and setPaperOrientation methods, but I can't find those methods in my C# code.
Here's my class I'm using:

Code: Select all

using System;
using System.Collections.Generic;
using System.Text;
using CDIntf;

namespace FillInWord
{
    class Amyuni
    {
        private CDIntf.CDIntfControl cdiNet = null;
        private Log Logger = new Log();

        /// <summary>
        /// Constructor
        /// </summary>
        public Amyuni()
        {
            try
            {
                cdiNet = new CDIntf.CDIntfControl();
                cdiNet.DriverInit(Declarations.PrinterName);
                return;
            }
            catch (Exception ex)
            {
                Logger.WriteLine(ex.ToString());
                throw ex;
                return;
            }
        }

        public Boolean printSettings(string pdfFile)
        {
            try
            {
                Logger.Write("Setting printersettings for Amyuni ... ");
                // Set the Printer as Default, this is needed only if you can not print to a specific printer
                cdiNet.SetDefaultPrinter();                
                //cdiNet.SetDefaultConfig();
                cdiNet.FileNameOptions = Declarations.NoPrompt + Declarations.UseFileName;
                cdiNet.DefaultFileName = pdfFile;
                
                // Enable the printer before each printout for the Developer version
                cdiNet.EnablePrinter(Declarations.LicensedTo, Declarations.ActivationCode);
                //Logger.WriteLine("Amyuni returned: " + cdiNet.GetLastErrorMsg());
                Logger.WriteLine("OK");
                return true;
            }
            catch (Exception ex)
            {
                Logger.WriteLine("ERROR");
                Logger.WriteLine("Amyuni returned: " + cdiNet.GetLastErrorMsg());
                Logger.WriteLine(ex.ToString());
                return false;
            }
        }


        /// <summary>
        /// Destructor
        /// </summary>
        ~Amyuni()
        {
            try
            {
                if (cdiNet != null)
                {
                    cdiNet.RestoreDefaultPrinter();
                    cdiNet.FileNameOptions = 0;
                    cdiNet.DriverEnd();
                    cdiNet.Dispose();
                    cdiNet = null;
                }

                return;
            }
            catch (Exception ex)
            {
                Logger.WriteLine(ex.ToString());
                return;
            }
        }        

    }
}
I call printSettings just before I tell my MS Word instance to print to the default printer. I previously used cdiNet.SetDefaultConfig(); but I read in the forum if you don't use it the settings of the Word document should be used.
Please advise how to proceed.

Thanks
Paul
The Netherlands
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Does this help: http://www.amyuni.com/forum/viewtopic.php?t=2131 ?

Do you have a physical printer or any other printer driver installed on the system?

MS Word will print to the PDF Converter and to any other Physical Printer using its own settings. You can force it to use the printer settings by calling SetPaperSize() and/or SetOrientation() followed by SetDefaultConfig().

Hope this helps.
pmeems
Posts: 11
Joined: Mon Jul 23 2007
Location: The Netherlands

Post by pmeems »

Thanks Joan,

But that doesn't work for me. I'd already read that topic.
I've got several physical printers installed, so that's not the problem.
As mentioned in my startpost:
I've search this forum and I stumbled on the setPaperSize and setPaperOrientation methods, but I can't find those methods in my C# code.
I don't know how to use SetPaperSize() or SetOrientation() because it isn't available using cdinet300.dll.
cdiNet.SetPaperSize() is not available. So If you could give me some C# sample code using the same dll and SetPaperSize() you'll make me day. :)

Thanks
Paul
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

SetPaperSize and SetOrientation are not availbable in CDIntfNet.

I double checked this issue and Word is supposed to send the files to the printer using its own settings, please check the following:

1 - that scaling is not enabled in the PDF Printer
2 - that when you print these same files to a physical printer the last file prints properly.
3 - Which version of the PDF Converter are you using?
4 - Which version of Word are you using?

Awaiting for your feedback.
pmeems
Posts: 11
Joined: Mon Jul 23 2007
Location: The Netherlands

Post by pmeems »

SetPaperSize and SetOrientation are not availbable in CDIntfNet.
So how do I set them?
1 - that scaling is not enabled in the PDF Printer
I'm not scaling, the Word document is A3 Landscape.
2 - that when you print these same files to a physical printer the last file prints properly.
The document is 1 or 2 pages and all pages are printed properly on the physical A3 printer.
3 - Which version of the PDF Converter are you using?
As mentioned in the subject of my startpost: 3.01.
To be precise. I've downloaded cdintf300.zip which contains CDIntfNet300.dll created on 23-03-2007 10:53
4 - Which version of Word are you using?
I'm using MS Office Professional Word 2003 (11.8134.8132) SP2
The testserver is using MS Office Standard Word 2003 SP2

This friday (august 10) I need to deliver my application. Everything is working except the two Amyuni issues:
  • Converting to A3 Landscape
    Printing pdfs to a physical printer
I hope you can help me.
pmeems
Posts: 11
Joined: Mon Jul 23 2007
Location: The Netherlands

A3 working in version 2.5

Post by pmeems »

It seems to be working in version 2.5. So I'm gonna use that version.
Too bad it's not implemented in v3

Now I have to figure out how to tell my application it should use the 250.dll instead of the 300.dll
peterwegrzyn
Posts: 24
Joined: Tue Aug 19 2003

Post by peterwegrzyn »

I'm having problems with 3.1 handling landscape/portarit and printing of PDF's as well. This seems to new a problem as its working in 2.5. I'm getting pages clipped and other problems, such as documents with combined landscape/portrait pages not being handled properly.
pmeems
Posts: 11
Joined: Mon Jul 23 2007
Location: The Netherlands

New dll

Post by pmeems »

Peter,

The support team has sent me a new version of CDIntfNet300.dll with the SetOrientation and SetPapersize exposed.:P

@Supprt team: Perhaps it's a good idea if the link is made public. :?:

I've seen the code to set the orientation and papersize but I haven't been able to test it yet because my trail has expired and the bought licensecode isn't working :cry:

[Edit]
I've uninstalled the previous version and installed the suite and now it's creating pdfs again. :P
BUT the orientation and papersize are still NOT used. So my A3 Landscape MSWord document is still converted to a A4 Portrait!!! :x :? :cry:

So I use the suite and the bought licence together with the sent CDIntfNet300.dll. I use it in this way:

Code: Select all

Logger.Write("Setting printersettings for Amyuni ... ");
// Set the Printer as Default, this is needed only if you can not print to a specific printer
if (!cdiNet.SetDefaultPrinter())
    throw new Exception("Cannot set the default printer.");
cdiNet.SetOrientation = orientation; //For Landscape it's 2
cdiNet.SetPaperSize = papersize; //For A3 it's 8
cdiNet.ImageOptions = Declarations.IO_NODUPLICATES;
if (!cdiNet.SetDefaultConfig())
    throw new Exception("Cannot set the default configuration for the printer.");
cdiNet.FileNameOptions = Declarations.NoPrompt + Declarations.UseFileName;
cdiNet.DefaultFileName = pdfFile;
// Enable the printer before each printout for the Developer version
if (!cdiNet.EnablePrinter(Declarations.LicensedTo, Declarations.ActivationCode))
    throw new Exception("Cannot enable the printer.");
How do I tell Amyuni to convert it to A3 Landscape!!!!!

Paul
peterwegrzyn
Posts: 24
Joined: Tue Aug 19 2003

Post by peterwegrzyn »

Is there a newer version of 3.01 that handles the orientation properly?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

We have tested this issue numerous times and paper size and orientation are working properly.

Please send your code to support@amyuni.com to check it.

Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Post Reply