Only problem at printing using printer

16 visualizaciones (últimos 30 días)
Eren Yeager
Eren Yeager el 24 de Ag. de 2023
Comentada: Walter Roberson el 25 de Ag. de 2023
qrCodeImagePath = 'qr.png';
% Read the QR code image
qrCodeImage = imread(qrCodeImagePath);
% Display the QR code image
imshow(qrCodeImage);
title('QR code');
% Adjust figure size to paper size
set(gcf,'PaperPositionMode','auto');
% Set paper orientation to landscape
set(gcf,'PaperOrientation','landscape');
% Specify printer
printerName = '-PTP518G';
% Print the QR code image to the printer
print(printerName, '-r300')
This is the Matlab script all is ok just at the printing part then popped out the warning below.
Warning: The figure is too large for the page and will be cut off. Resize the figure, adjust the output size by setting the figure's PaperPosition property, use the 'print'
command with either the '-bestfit' or '-fillpage' options, or use the 'Best fit' or 'Fill page' options on the 'Print Preview' window.
> In validate (line 146)
In print (line 67)
In qrcode (line 20)

Respuestas (1)

Walter Roberson
Walter Roberson el 24 de Ag. de 2023
The qr.png image that you displayed occupies more than about 8 inches wide when displayed. When you ask to print that, the settings you have are that it should keep that screen width -- but since that is wider than the size of the printer paper, that it should deal with that by cutting off part of the image.
If you want the image to be automatically rescaled to fit the size of the paper, then use
print(printerName, '-r300', '-bestfit')
  2 comentarios
Eren Yeager
Eren Yeager el 25 de Ag. de 2023
what's the difference between bestfit and fillpage.I tried bestfit before but then the printer sound like stucking and unable to print out anything.
Walter Roberson
Walter Roberson el 25 de Ag. de 2023
"bestfit" preserves aspect ratio; "fillpage" does not preserve aspect ratio.

Iniciar sesión para comentar.

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by