DPI "agnostic" VectorDrawing() output - fixing printout size

Just starting out? Need help? Post your questions and find answers here.
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

DPI "agnostic" VectorDrawing() output - fixing printout size

Post by bbanelli »

Greetings to all,

perhaps I'm tired and overlooking something, but I have a big problem at the moment - if I output a vector drawing to printer via StartVectorDrawing(PrinterVectorOutput()), it seems to be DPI dependent - IOW, if I set my printer to 1200 DPI (ie.), it will print to scale, but if i set it to 600 or 2400 DPI it will print two times smaller and two times bigger respectively.

What is the most convenient way to "fix" such outputs regardless of DPI settings in printer? Crossplatform?

Additionally, how can I define size of the PrinterVectorOutput() "canvas" (page size?)?

With my very best,

Bruno
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: DPI "agnostic" VectorDrawing() output - fixing printout

Post by davido »

@bbanelli,

I can confirm that. I've been searching for a solution.

Thanks for bringing the matter up.
DE AA EB
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: DPI "agnostic" VectorDrawing() output - fixing printout

Post by bbanelli »

Although it's hellishly hot in my part of Europe and I'm dead tired, I might be on to something.

I have calculated RatioX and RatioY by dividing actual VectorResolutionX/Y() with 1200. I'm not really sure how to get "1200" value (or perhaps that's a default one?) but it seems to be working for me at the moment for all resolutions of printer from 144 to 4000 DPI, triend on Acrobat Distiller, Lexmark T654, HP LaserJet 400 and Ricoh SP C240 with resolutions as available - all scaling properly.

Code looks something like this:

Code: Select all

RatioX = VectorResolutionX()/1200
RatioY = VectorResolutionY()/1200
ScaleCoordinates(RatioX, RatioY)
MovePathCursor(X/RatioX, Y/RatioX)
Perhaps there's a better way?
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
Post Reply