[Gambas-user] print resolution issues

Paul Horechuk horechuk at ...981...
Mon Oct 13 20:22:04 CEST 2014


Thank you for the examples.

It appears we are doing a similar process. You use 72 as the resolution 
and with 25.4 mm per inch, you get a factor of 0.352778 (MM_X_PX).

I use 100 for the resolution and use the page dimensions of the page in 
inches to get 850 x 1100 for US letter size. If I change to a res of 72 
then I should use 1.38889 as my adjustment factor or rather than 
dividing by the factor, I would multiply by 72/100 or 0.72. I would then 
use a page size of 8.5 x 72 or 612 wide and length is 792. Each offset 
is then multiplid by 0.72.

As a result of this, my code does write to a pixel scale, just with a 
different resolution. Significant? Probably not. However, your code does 
print OK to a .pdf. Strange.

On 14-10-10 06:04 PM, Gian wrote:
> Sorry but for my scarce English I did not understand how did you print
> to your HP.
>
> Anyway , I think that if you want to get the same proportions between
> what you see on the screen and what you print (with millimeter
> accuracy), have to look to compensation factors.
>
> For example with the components gb.qt4 and gb.qt4.ext, I use 0.352778
> for change mm in px, I use 72 for print resolution and I use the
> compensation factor for the font size (see my examples).
>
> hope that helps
>
> gianluigi
>
> PS: But I think that GTK not interested at the resolution. :-)
>
>
> Il 10/10/2014 21:12, Paul Horechuk ha scritto:
>> Thanks. I'll check them out.
>>
>> On 14-10-10 05:04 AM, Gian wrote:
>>> Hello Paul,
>>>
>>> attached two small demonstrations that might inspire you.
>>> gianluigi
>>>
>>>
>>>
>>>> Le 08/10/2014 18:20, Paul Horechuk a écrit :
>>>>> I have a successful project that formats a sheet of labels on an Avery
>>>>> form and prints directly to an HP OfficeJet 7500 E910.
>>>>>
>>>>> I set the printer width to 850 and length to 1100 with a resolution of
>>>>> 100. These may not be correct for all (PrinterWidth and length are seen
>>>>> as 216 by 279mm), but by setting moveto coordinates within this
>>>>> range, I
>>>>> do get a correct sheet of labels.
>>>>>
>>>>> Problems:
>>>>>
>>>>> On a customer printer with the same version of gambas 3.5.4, the
>>>>> coordinates are stretched so that the labels are stretched by about
>>>>> 50%.
>>>>> This is on a Canon Pixma.
>>>>>
>>>>> Further checking shows a print to file (as PDF) from the printer
>>>>> dialog,
>>>>> resulting in:
>>>>>
>>>>>       *    vertical resolution is about 1/4 of what it should be
>>>>>       *    fonts are correctly sized
>>>>>       *    horizontal positioning is about 1/4 as well
>>>>>       *    therefore all text is compressed into the upper left
>>>>>       *    a QR code is about 1/4 the expected size
>>>>>
>>>>>
>>>>> Changing the resolution for a direct print to Pixma has no effect.
>>>>> Changing from 100 to 75 or to 150, results in the same stretched
>>>>> printout. This works as expected on the HP.
>>>>>
>>>>> Suggestions?
>>>>>
>>>> The first thing I can quicky tell you: you must not use the printer
>>>> resolution when drawing on a printer.
>>>>
>>>> If you use it, then something is doomed in your drawing routine, unless
>>>> you want to draw at the pixel level, for example the thinest possible
>>>> line (one pixel). Then you need the printer resolution, but this is the
>>>> only case.
>>>>
>>>> Otherwise, in all normal printing routines, printer resolution is not
>>>> needed.
>>>>
>>>> But maybe I didn't understand what you wrote...
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>>>
>>>
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

-- 
Think Free ...
    Use Open Source Software





More information about the User mailing list