Issue with Amyuni Document Converter 3.00

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
NSiteSupport
Posts: 3
Joined: Wed Dec 19 2007

Issue with Amyuni Document Converter 3.00

Post by NSiteSupport »

We have been receiving reports of an issue where users that have HP drivers/software installed are occasionally getting a "blank" PDF output from the Amyuni Document Converter 3.00. The resulting documents appear as a very small square when viewed in Adobe Acrobat 7, and have to be magnified to 6500% to be seen as a slightly larger blank square.

Looking around in the forums shows that prior versions of the Document Converter have had issues with HP drivers/software, and I also viewed some similar issues on the Intuit Quicken forums, who also use Amyuni.

Any information on this issue would be appreciated.
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

Not sure about what posts you are referring to but the issue you have described generally occurs when the user tries to generate a PDF document with an incorrect page size. This usually happens when the developer incorrectly sets a page size and is not related to HP drivers.

Hope this helps?
NSiteSupport
Posts: 3
Joined: Wed Dec 19 2007

Post by NSiteSupport »

This is most assuredly an issue with a conflict between HP drivers or software and the Amyuni Document Converter. We have two large customers, each with hundreds of users, all using the same source program to print from. One customer, who does not use HP printers, has not reported the issue at all. The other customer, who uses HP printers, have reported the issue occurring multiple times consistently. Every user having this issue has had an HP printer installed, and other users for the same company without an HP printer installed never have the issue.

Additionally the error only occurs when the Amyuni PDF Printer is selected as the default printer in Windows XP.

Past thread referring to this issue:

http://www.amyuni.com/forum/viewtopic.p ... ight=blank

If you are not aware of this issue I can work with our developers to send over more technical information of what our application is doing that might be causing a conflict to occur.
sprezzatura
Posts: 46
Joined: Fri Nov 18 2005
Location: Nova Scotia

Post by sprezzatura »

This is your lucky day. We experienced the same problem, and found that it was caused by un-initialized fields in the DEVMODE struct which were throwing the Amyuni driver for a loop.

The solution is to make sure each and every field is defined and nailed down. The reason it only happens with some printers is probably because you're picking up the un-initialized values of the default printer. Since printer drivers ignore some fields depending on the circumstances, they are not bothered by garbage values.

Here's a sample of what you need to do. The code is not complete, but it gives you an idea. I think somewhere prior to this we set the DEVMODE fields to zero.

Code: Select all

HDC initPDFPreview(PRINTER_INFO_2 **pfo, char *publish_filename)
{	pdev = (DEVMODE*)GlobalLock(gv->pd->hDevMode);
	if (pdev && (isLocalPrinterInstalled(SZ_PDFPRINTER, SZ_PDFDRIVER, pfo)))
	{	
		if (pfo && (*pfo)->pDevMode)
		{	// Let the driver know what it is we're setting
			(*pfo)->pDevMode->dmFields = DM_ORIENTATION | DM_COLOR | DM_PRINTQUALITY;

			if(pdev->dmPaperSize > 0)
				(*pfo)->pDevMode->dmFields |= DM_PAPERSIZE;

			/*	Only use dmPaperLength and dmPaperWidth if Custom paper size.
				"Custom 1" is DMPAPER_USER + 1, etc.
				dmPaperLength and dmPaperWidth are not initalized correctly
				the first time for some printers (HP 990C, HP P1000 PhotoSmart)
			*/
			if(pdev->dmPaperSize >= DMPAPER_USER
			&& pdev->dmPaperLength > 0 && pdev->dmPaperWidth > 0)	// Amyuni takes it seriously
				(*pfo)->pDevMode->dmFields |= DM_PAPERLENGTH | DM_PAPERWIDTH;

			if(pdev->dmScale > 0)
				(*pfo)->pDevMode->dmFields |= DM_SCALE;

			(*pfo)->pDevMode->dmOrientation = pdev->dmOrientation;

			if(theAmyuni.m_bAmyuniIsSelected && theAmyuni.isPaperSizeDefined())
			{	(*pfo)->pDevMode->dmPaperSize = DMPAPER_USER;
				(*pfo)->pDevMode->dmPaperLength = theAmyuni.getHeightMM();
				(*pfo)->pDevMode->dmPaperWidth = theAmyuni.getWidthMM();
				(*pfo)->pDevMode->dmScale = 100;	// 100%
				(*pfo)->pDevMode->dmFields |= DM_PAPERLENGTH | DM_PAPERWIDTH;
				(*pfo)->pDevMode->dmOrientation = DMORIENT_PORTRAIT;	// Keep width as width (else reverses)
			}
			else
			{	(*pfo)->pDevMode->dmPaperSize = pdev->dmPaperSize;
				(*pfo)->pDevMode->dmPaperLength = pdev->dmPaperLength;
				(*pfo)->pDevMode->dmPaperWidth = pdev->dmPaperWidth;
				(*pfo)->pDevMode->dmScale = pdev->dmScale;
			}
			(*pfo)->pDevMode->dmPrintQuality = pdev->dmPrintQuality;
			
			if(AMYUNI_STYLE)
			{	// Amyuni inherits monochrome from default printer
				(*pfo)->pDevMode->dmColor = DMCOLOR_COLOR; // pdev->dmColor;
				// get proper page width & length

				theAmyuni.setFileName(publish_filename);
				dc = CreateDC( "WINSPOOL", SZ_PDFPRINTER, NULL, (*pfo)->pDevMode);
			}

NSiteSupport
Posts: 3
Joined: Wed Dec 19 2007

Post by NSiteSupport »

Outstanding, thank you for the assistance.
Post Reply