Something is still not right - tried the code below and the results show after it. My scale is 1
Taking the MeasureStringWidth and dividing it by LayoutsValues.Scale seems to work on 3 different devices I have (One has a scale of 1, two others have a scale of 2 & 3).
I just don't understand why - I tried looking by have not been able to locate what MeasureStringWidth returns.
I know the PDFWriter is returning the proper Paper Width 612 / 72 = 8.5 which is what I am using
Dim Width As Int = mCanvas.MeasureStringWidth(FmtLabel.Text, FmtLabel.Typeface, FmtLabel.TextSize)
Log("Width1:" &Width &" What I would Return:" &(Width / mLayoutValues.Scale) &" Alternate Return:" &(Width / (mLayoutValues.Scale * 160) / 72) &" PaperWidth:" &mPDFPaperSize.LETTER_WIDTH)
Width1:182 What I would Return:182 Alternate Return:0.01579861111111111 PaperWidth:612
I have also tried all of these:
Log("Width1:" &Width &" What I would Return:" &(Width / mLayoutValues.Scale) &" Alternate Return:" &(Width / (mLayoutValues.Scale * 160) / 72) &" PaperWidth:" &mPDFPaperSize.LETTER_WIDTH)
Log("Width2:" &Width &" What I would Return:" &(Width / mLayoutValues.Scale) &" Returns Inches??:" &(Width / (mLayoutValues.Scale * 160)) &" PaperWidth:" &mPDFPaperSize.LETTER_WIDTH)
Log("Width3:" &Width &" What I would Return:" &(Width / mLayoutValues.Scale) &" Returns 72's:" &(Width / (mLayoutValues.Scale * 160dip) * 72) &" PaperWidth:" &mPDFPaperSize.LETTER_WIDTH)
Width1:453 What I would Return:453 Alternate Return:0.039322916666666666 PaperWidth:612
Width2:453 What I would Return:453 Returns Inches??:2.83125 PaperWidth:612
Width3:453 What I would Return:453 Returns 72's:203.85 PaperWidth:612
Much as I feel that the 72's number is what I want. If causes anything based on the field width to be off by more than half
I really appreciate you looking at this but don't want to eat up your time.
But I feel sure once everyone starts printing this could be a problem more are interested in.
If I get to convert to PdfDocument maybe it's canvas MeasureString (if there is one) will just return the proper width for a printer?
BobVal