How to set "Fit to Page" printer settings

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
tharanginiakula
Posts: 4
Joined: Thu May 07 2015

How to set "Fit to Page" printer settings

Post by tharanginiakula » Fri May 08 2015

Hi
I am using Amyuni pdf converter version 4 and I need to set the printer settings "Fit to Page" in the code.
I am unable to find any such properties in the cdintfnet dill.
Request to suggest me the code snippet to have "Fit to page" setting.

Thanks
Tharangini

Jose
Amyuni Team
Posts: 550
Joined: Tue Oct 01 2002
Contact:

Re: How to set "Fit to Page" printer settings

Post by Jose » Fri May 08 2015

Hi Tharangini,

Sorry but I am not totally following your question? Can you elaborate slightly on what you are trying to achieve?

thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite

tharanginiakula
Posts: 4
Joined: Thu May 07 2015

Re: How to set "Fit to Page" printer settings

Post by tharanginiakula » Mon May 11 2015

Hi Jose
I am using the following code to convert the given excel file in to pdf.

cdiNet.EnablePrinter(_company, _code);
// Set FileNameOptions and output file name.
cdiNet.FileNameOptions = Convert.ToInt32(NoPrompt + UseFileName + EmbedFonts + MultilingualSupport + EmbedStandardFonts + EmbedLicensedFonts);
//cdiNet.FileNameOptions = Aveva.EI.Utilities.ConvertNice.ToIntegerInvariant(NoPrompt + UseFileName + EmbedFonts + MultilingualSupport + EmbedStandardFonts + EmbedLicensedFonts);
cdiNet.DefaultFileName = OutputFilePathName;
//set the paper to A4
cdiNet.SetPaperSize = 9;
// Set the PDF Printer as Default, this is needed only if you can not print to a specific printer
cdiNet.SetDefaultPrinter();
// Call the actual printmethod
PrintMethod();
// Reset the default printer to whatever it was before
cdiNet.RestoreDefaultPrinter();

How ever some times if there is only one sheet in the excel file, its been printed in to two pages (the content is divided and printed in to 2 pages of pdf file)
In my excel sheet i have 47 rows and columns up to "P" (16 columns)
This sheet is printed upto 9 columns in first pdf file and rest of the columns are going to 2nd pdf page.
I have set the all the columns correclty in "Page break preview" of excel file, then also they are getting divided in pdf file.
In AMyuni printer properties if we set the "Fit to page" property manually, then pdf file is generating proprly.
This setting i need to do in c# coding rather than doing it manually.
The corresponding c# property i am unable to find, where i need some help.
Hope this explanation is sufficient to understand the problem i am facing.

tharanginiakula
Posts: 4
Joined: Thu May 07 2015

Re: How to set "Fit to Page" printer settings

Post by tharanginiakula » Fri May 15 2015

Hi Jose
Any update in this issue?

Jose
Amyuni Team
Posts: 550
Joined: Tue Oct 01 2002
Contact:

Re: How to set "Fit to Page" printer settings

Post by Jose » Fri May 15 2015

Hi,

Sorry but I am following where in the Amyuni printer properties you are setting the "Fit to page" property manually. Can you send a screen shot to support@amyuni.com?

Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite

Jose
Amyuni Team
Posts: 550
Joined: Tue Oct 01 2002
Contact:

Re: How to set "Fit to Page" printer settings

Post by Jose » Fri May 15 2015

Hello,

I took a closer look at this and I believe you may need to handle this in the code where you print your XLS file.

The link below points MSDN where the PageSetup.FitToPagesWide and PageSetup.FitToPagesTall Properties are explained.
https://msdn.microsoft.com/EN-US/librar ... 94365.aspx

Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite

tharanginiakula
Posts: 4
Joined: Thu May 07 2015

Re: How to set "Fit to Page" printer settings

Post by tharanginiakula » Mon May 18 2015

Thanks for the update Jose, I will try the code as you suggested.
However I was under the impression that fit to page properties are also available for amyuni pdf converter dll, if any such properties exists do let me know.

Regards
Tharangini

thomas_huber
Posts: 9
Joined: Wed Apr 10 2013

Re: How to set "Fit to Page" printer settings

Post by thomas_huber » Wed Dec 16 2015

Hello Jose,

is this option available in the amyuni-dll-version as well?
https://www.amyuni.com/WebHelp/Amyuni_P ... cument.htm

ScaleToPrinter

I have the following problem and it seems to fit in this thread.

I know some scanner creating a pdf with smaller than A4 dimensions.
For example you scan a page with only a pair of circles and lines on it, the scanner appplication creates a A4 document but not with 210mm x 297mm (as you expected) but with the dimension 204mm x 297mm.

So I need a function where I can print it into a real A4 document with the right dimensions.
And this "fit to page" or scale to printer feature could help at this point.

I played around with PrintPdfDocument( "c:\temp\doc1.pdf", "Amyuni Printer Driver" ,1, 999, 1 );
But this is not the solution.
The document has the same dimension after this procedure.
(you are doing a great job with your printer driver - we have found the turbo-button)

Best regards,
Thomas

Jose
Amyuni Team
Posts: 550
Joined: Tue Oct 01 2002
Contact:

Re: How to set "Fit to Page" printer settings

Post by Jose » Thu Dec 17 2015

Hi,

I believe you can accomplish this using the scaling option of the PDF Converter. You can set this option in the PDF Converter and reprint your scanned PDF file to the Amyuni printer.

I have included below a link to our online help below and a code snippet which illustrates how to implement this option.

http://www.amyuni.com/WebHelp/Amyuni_Do ... Option.htm

//SIO_SCALE ==> scale by a percentage (ScalingPercent)
SetScalingOption(hPrinter, SIO_SCALE);

//scale out-put 10%
SetScalingPercent(hPrinter, 10);

//Apply changes
SetDefaultConfig(hPrinter);

Hope this helps?
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite

Post Reply