Print PDF
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Print PDF

  1. #1
    Join Date
    Jul 2012
    Posts
    3

    Print PDF

    Hey friends,

    I would greatly appreciate some help with my question. I am really stumped why my code below does not print. I am using C++ 6.0 and all I want to do is print a PDF (with PrintSilentPages supplied by Acrobat SDK) that I have stored on my computer. The code compiles fine and seems like it should work but nothing prints. I have researched this extensively without success.

    Additional information:

    I am on a Windows 7 64-bit machine (don't believe this matters)
    I am using Adobe Acrobat SDK X
    Have Adobe Reader X 10.1.4 installed

    I am able to get this to work by using a Shell Command but for my scenario I need to do this through the SDK.

    I have also tried this with Acrobat 9 SDK.

    I am hoping there is someone with experience with this or some expert that can help me out.

    Thank you in advance for reading my post!

    Code:
         COleException e;
    
         CAcroAVDoc * pAcroAvDoc = new CAcroAVDoc();
         pAcroAvDoc->CreateDispatch(TEXT("AcroExch.AVDoc"), &e);
    
         CString strPathName = "C:\\Artawork\\PDF\\";
         CString strFileName = "ExamplePDF.pdf";
    
         pAcroAvDoc->Open(strPathName, strFileName);
    
         pAcroAvDoc->PrintPagesSilent(0, 2, 1, 1, 1);
    
         pAcroAvDoc->Close(1);

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,359

    Re: Print PDF

    1. Are you using ANSI or UNICODE build for your project?
    2. Did you debug this code?
    3. Is this code snippet executed?
    4. What do these methods: Open, PrintPagesSilent, Close return? And what are the possible return values according the Docs?
    5. Does the SDK support 64-bit machine?
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2012
    Posts
    3

    Re: Print PDF

    Thanks for your help Victor. I found out this morning on another forum that you need the full version of Adobe to use PrintPagesSilent... not just Reader.

    Just wanted to update in case someone else reads this thread.

    D

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center