Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Aug 15, 2017 8:07 pm

I am having trouble finding documentation on what each of the enumerations do
ActualSize
CustomSize
FitSize
ShrinkOverSize

It appears for my needs I want ActualSize but I need to adjust the margins and its not happening leaving me to wonder if I really need to be in CustomSize but lack of documentation is making this guessing game not easy.

Basically when its in 'ActualSize' I just need to move it all down about .1 of an inch

seanw432
 
Posts: 6
Joined: Thu Jun 15, 2017 3:13 pm

Wed Aug 16, 2017 7:11 am

Hello,

Thanks for your inquiry.
First, our Spire.Pdf is based on the "Portrait" orientation in the adobe print settings.
Below are the explainations to the page scaling choices.

ActualSize: printing at the top left with the actual size of the page.
CustomSize: printing in the center with the custom scaling you want.
FitSize: automatically adjust the size of the content to adapt the page size
ShrinkOverSize: printing in the center with the actual size of the page.

You could choose the one you need accordingly.
In addition, if you need to adjust the margins, please use the code:
Code: Select all
doc.printDocument.OriginAtMargins = true;
doc.PrintDocument.DefaultPageSettings.Margins = new Margins(100, 0, 100,0 );


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Aug 16, 2017 5:45 pm

Awesome that helped us narrow our issue down.

That said, we are having trouble with the upper margin when printing labels.
I know there is likely a ton of variables that you cant control but I was curious if you have any insight to this information below.

--------
I tried each of the PdfPrintPageScaling options from ActualSize to ShrinkOverSized and it appears 'ActualSize' suits what I am doing the best, and although left and right margin is working as expected, top margin has no affect even using a number like 1000.
Moreover, this is only happening on a label printer. On a standard printer top margins is affecting the outcome as expected.

any hints?

seanw432
 
Posts: 6
Joined: Thu Jun 15, 2017 3:13 pm

Thu Aug 17, 2017 8:58 am

Hello seanw432,

Thanks for your response.
Could you please share your code with us so we can look into it? Also, please tell us which version you are using.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Aug 17, 2017 4:54 pm

Dim PDFDoc As New Spire.Pdf.PdfDocument
PDFDoc.LoadFromBytes(Me.GlobalUtilityMethods.ReturnReportToStream(Me.rvLabels))
PDFDoc.PageScaling = Spire.Pdf.PdfPrintPageScaling.ActualSize 'starts the print at the upper left. other properties start at the center
PDFDoc.PrintDocument.OriginAtMargins = True 'Required for margins to work
PDFDoc.PrintDocument.DefaultPageSettings.Landscape = True
PDFDoc.PrintDocument.DefaultPageSettings.Margins = New System.Drawing.Printing.Margins(0, 0, 100, 0)
PDFDoc.PrintDocument.DocumentName = "Labels"
PDFDoc.PrintDocument.PrinterSettings.PrinterName = HostName + Me.rcbLabelPrinters.SelectedValue
PDFDoc.PrintDocument.PrinterSettings.Copies = CShort(Me.txtLabelCopies.Value)
PDFDoc.PrintDocument.Print()

Spire Version: 3.9.189.2040

Important: This is only happening with a label printer, same code going to a standard printer performs as expected. I will edit this thread once I get the exact name of the label printer which I am about to go get now.
and 'this' is adjusting left and right margins work but top and bottom do not.
also, this is an SSRS report I will here in a bit inspect the height of the report. part me thinks that maybe it doesnt have anywhere to go up or down.

Printer: Zebra 170Xi2

seanw432
 
Posts: 6
Joined: Thu Jun 15, 2017 3:13 pm

Fri Aug 18, 2017 10:32 am

Hello,

Thanks for your details.
Since we have no such device to reproduce the issue, it's hard to detect the cause now.
We will keep looking into it and once there's any update, we will inform you.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.PDF