Print Page | Close Window

Cannot able to fill and print PDF document

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3398
Printed Date: 04 May 24 at 4:08AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Cannot able to fill and print PDF document
Posted By: rizzz86
Subject: Cannot able to fill and print PDF document
Date Posted: 17 Oct 16 at 7:40AM
I am trying to fill a PDF document using "SetFormFieldValue" function and after filling I want to print the filled document using "PrintDocument" function.

Both functions are working fine individually i.e. "SetFormFieldValue" is filling the PDF as I can see the filled PDF when I save it to local file. Also "PrintDocument" prints the PDF. The issue is "PrintDocument" prints the empty (unfilled) PDF document.

Following is the code I am using:

int isloaded = QP.LoadFromVariant(PDFStream, "");
QP.SetFormFieldValue(fieldNumber, "TextToSet");

int iPrintOptions = QP.PrintOptions(1, 1, "Title");
QP.PrintDocument("printerName", 1, QP.PageCount(), iPrintOptions);

Please confirm what I am missing here?

rizzz86



Replies:
Posted By: Ingo
Date Posted: 17 Oct 16 at 9:35AM
Hi Rizzz,

Regarding this case you have to know a bit about appearance streams:
http://www.debenu.com/kb/appearance-streams-pdf-form-fields/
Please read addionally about SetFormFieldPrintable:
http://www.debenu.com/docs/pdf_library_reference/SetFormFieldPrintable.php
After maintaining a form field the appearance stream should be set to value 1 to show/print the value in a pdf-viewer:
http://www.debenu.com/docs/pdf_library_reference/SetNeedAppearances.php

Here's a working sample from a user:
http://www.quickpdf.org/forum/vb6-print-pdf-on-the-fly_topic232_post814.html?KW=SetNeedAppearance#814


Cheers and welcome here,
Ingo




-------------
Cheers,
Ingo



Posted By: rizzz86
Date Posted: 17 Oct 16 at 10:30AM
Hi Ingo,

Thanks, it worked.

Setting and Updating appearance stream worked for me.

rizzz86



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk