Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
rnwcoates@gmail.com #1
PrintPagesSilent not working
I have tried the SDK PrintPages and PrintPagesSilent functions with no
results. I do not get a printed page, a dialog box, or an error. This
is running via a simple Windows Forms C# application that displays a
form with a single button. That button calls the class function shown
below.
I can open Acrobat, open a document, and click the print button to
print to the default printer, so I would assume that the Acrobat setup
is not an issue.
Thanks for any help!
- Randy
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Acrobat;
namespace TestAdobePrinting
{
/// <summary>
/// Prints a PDF file to a given printer using the Adobe SDK.
/// </summary>
class PDFPrinterSDK
{
public static void PrintPDF(string pdfFilePath)
{
CAcroApp acrobat = new AcroAppClass();
acrobat.Hide();
try
{
CAcroAVDoc avdoc = new AcroAVDocClass();
if (avdoc.Open(pdfFilePath, ""))
{
CAcroPDDoc pddoc = (CAcroPDDoc)avdoc.GetPDDoc();
int numPages = pddoc.GetNumPages();
if (! avdoc.PrintPages(0, numPages - 1, 3, 1, 0))
{
// error occurred
throw new ApplicationException("Report did not
print due to Adobe error.");
}
}
else
{
throw new ApplicationException("Adobe SDK cannot
open the file " + pdfFilePath);
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
acrobat.CloseAllDocs();
acrobat.Exit();
acrobat = null;
}
}
}
}
rnwcoates@gmail.com Guest
-
#38816 [Opn]: PHP code that was working perfectly recently stopped working.
ID: 38816 User updated by: mtoohee at gmail dot com -Summary: PHP code that was working perfectly recently stopped.... -
Macromedia Flash Player installed and working properly suddenlys stops working..
No idea what has caused the Flash player to stop working. This is not my machine but a relatives who has asked for help over the T'giving... -
Data not working on Label but is working in Datagrid
I am creating a simple website in Flex. I want to show different content from the database for home, about us, contact us, etc. I am using a CFC as... -
PrintPagesSilent only works in Acrobat 6 and not in Acrobat 7
Hello All, I'm having an issue with the following code & Acrobat 7. This code takes a stored pdf path from a database and prints it to the... -
Acrobat 7 and PrintPagesSilent
I'm having a few problems using PrintPagesSilent with Acrobat 7.0. I'm using an MFC class created from the Acrobat type library. Everything works...



Reply With Quote

