Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Print document on custom paper size |
Post Reply ![]() |
Author | |
hirdan ![]() Beginner ![]() Joined: 22 Aug 14 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() Posted: 22 Aug 14 at 10:39AM |
Hi,
I have an existing PDF document which has the size 4x6 inch (orientation: landscape). I want to print it with Quick PDF on a label printer in exactly the original size. I tried to use the SetupCustomPrinter function to set length and width of the page but it doesn't work. Output size is always A4, even if I specify a custom length/ width. The size changes if I use the DMPAPER_XXX parameter with the SetupCustomPrinter function, but the DEVMODE data structure doesn't provide the required paper size for me. Any solutions on this? Why is the paper size not changing even if I set it? Thanks in advance and kind regards Daniel
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Daniel,
SetupCustomPrinter changes the properties of a custom printer created first with the NewCustomPrinter. And for working with NewCustomPrinter you should use GetPrinterNames, too. You should read here: http://www.debenu.com/docs/pdf_library_reference/SetupCustomPrinter.php and the further linked pages, too. Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
![]() |
|
hirdan ![]() Beginner ![]() Joined: 22 Aug 14 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
I'm aware of the NewCustomPrinter function and I'm already using it. SetupCustomPrinter works fine for other parameters (like orientation for example) but unfortunately not for the paper length and width. Any other suggestions on this? Thanks and kind regards Daniel
|
|
![]() |
|
hirdan ![]() Beginner ![]() Joined: 22 Aug 14 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
So I use the following code, but the page is always printed in A4 format. I use PDF Creator for testing, which works fine if I print different sized documents in MS Word for example.
string custom_printer = this.pdf_lib.NewCustomPrinter("SamplePrinter"); Edited by hirdan - 26 Aug 14 at 1:55PM |
|
![]() |
|
JensBP ![]() Beginner ![]() ![]() Joined: 19 Dec 06 Location: Denmark Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi Daniel
Have you tried with this sequence: SetupCustomPrinter(custom_printer, 1, 0); //Set PaperSize to Zero SetupCustomPrinter(custom_printer, 2, 1000); //Set PaperLength to 100mm SetupCustomPrinter(custom_printer, 3, 1500); //Set PaperWidth to 150mm According to Microsoft documentation the PaperSize can be set to 0 when the size id set by PaperLength and PaperWidth. I have not tested this. Jens Bejer Pedersen |
|
![]() |
|
hirdan ![]() Beginner ![]() Joined: 22 Aug 14 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
Hi Jens and thank you for your response.
I already found this part of the documentation before and tested it. Anyway SetCustomPrinter returns 0 (error) if you try to set the paper size to 0. According to the QuickPDF documentation the paper size parameter supports only values between 1 and 68.
|
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
This seems to be a bug in DQPL. I have changed the code to allow for option 0 to be specified for PaperSize to allow for customer page sizes to be used. I won't have time to test it but the fix will be part of the next release. Andrew.
|
|
![]() |
|
sudip ![]() Beginner ![]() Joined: 09 Jan 15 Location: Kolkata Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
I tried with the latest update and coded as per latest documentation. But it doesn't work
My (equivalent) C++ code is like : cPrinter=oPdf.NewCustomPrinter(cActualPrinter); oPdf.SetupCustomPrinter(cPrinter,0,0); oPdf.SetupCustomPrinter(cPrinter,2,nPaperLength*10); oPdf.SetupCustomPrinter(cPrinter,3,nPaperWidth*10); It doesn't print custom paper size. Is there any mistake in my code? Can anyone please help Thanks Sudip
Edited by sudip - 09 Jan 15 at 1:55PM |
|
![]() |
|
LuProch ![]() Beginner ![]() ![]() Joined: 01 Feb 13 Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
I had a similar problem - to print a pre-existing PDF file in A6 portrait format to a printer to the same paper format. I was not able to make it work with the SetupCustomPrinter function alone, but I found a workaround. You can alter the PDF itself - add new A4 page, cut the original page (A6 or any other page size) and paste it into the top of the new A4 page,
where you center it horizontally (or left or right or anywhere you need it). Then you print the resulting A4 page
normally and put A6 paper to the center of the A4 paper tray.
See my answer here: Debenu Quick PDF Library 11 don't support A6? |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store