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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - How can I use RenderPageToDC on Mac?
  FAQ FAQ  Forum Search   Register Register  Login Login

How can I use RenderPageToDC on Mac?

 Post Reply Post Reply
Author
Message
Aleksandr View Drop Down
Beginner
Beginner


Joined: 26 Aug 13
Location: Russia
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aleksandr Quote  Post ReplyReply Direct Link To This Post Topic: How can I use RenderPageToDC on Mac?
    Posted: 26 Aug 13 at 7:44AM
I use methods RenderPageToDC, SetRenderDCOffset and SetRenderScale on windows platform. The "Debenu Quick PDF Library 9.15 Mac Reference Guide.pdf" contains functions RenderPageToDC, SetRenderDCOffset, SetRenderScale. What is "DC - The device context handle" on mac? CGConextRef?  Can you tell how to use it, or to show an example?

Your readme.txt contains: 
"The Mac version of the library is still in beta and is missing a few of the features that the Windows version has. The following functions are not currently supported in the Mac version:
AddSubsettedFont
...
AddTrueTypeSubsettedFont
DARenderPageToDC
...
PrintDocument
PrintOptions
..."
is this true?
If it's true, then when will they become available?
Back to Top
Aleksandr View Drop Down
Beginner
Beginner


Joined: 26 Aug 13
Location: Russia
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aleksandr Quote  Post ReplyReply Direct Link To This Post Posted: 26 Aug 13 at 7:44AM
Hi Alexander,
Thanks for your email.
> What is “DC – The device context handle” on mac? 
> CGConextRef? Can you tell how to use it, or to 
> show an example?
You can get the device context on Mac using CGContextRef. We don’t have any sample code for this at the moment but I’ll see if we can create some for you today to help you get started.
We hope to add support for the other functions in the Ma version later in the year.
Cheers,
- Rowan.

Back to Top
Aleksandr View Drop Down
Beginner
Beginner


Joined: 26 Aug 13
Location: Russia
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aleksandr Quote  Post ReplyReply Direct Link To This Post Posted: 26 Aug 13 at 7:44AM
I'm sorry, can I ask one more question?

In readme.txt: The dylib for Debenu Quick PDF Library is 32-bit only and so the XCode project must be set to 32-bit mode.

When you plan to release a 64 bit version?

thank you very much Cheers

Back to Top
Aleksandr View Drop Down
Beginner
Beginner


Joined: 26 Aug 13
Location: Russia
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aleksandr Quote  Post ReplyReply Direct Link To This Post Posted: 26 Aug 13 at 7:44AM
example 1:

        _QP = new DebenuPDFLibraryDylibCPPClass0915(dllFileName);

        if (!_QP->LibraryLoaded()) {

  return;

}

        if (_QP->UnlockKey(strLicenseKey) != 1) {

            return ;

        }

        if (_QP->LoadFromFile(L"/Users/aleksandr/Desktop/debenu_quick_pdf_library_mac/license.pdf", L"") == 0) {

            return;

        }

        currentDocumentID =_QP->SelectedDocument();

        _QP->SetRenderDCErasePage(1);


        std::cout  << "PdfTool::openFile: SelectedDocument = " << currentDocumentID << std::endl;

        std::cout  << "PdfTool::openFile: DocumentCount = " << _QP->DocumentCount() << std::endl;

        std::cout  << "PdfTool::openFile: PageCount = " << _QP->PageCount() << std::endl;

        std::cout  << "_QP->SelectPage="<< _QP->SelectPage(1) << std::endl;

        std::cout  << "_QP->SelectedPage=" << _QP->SelectedPage() << std::endl;

        std::cout  << "_QP->PageWidth="<< _QP->PageWidth() << std::endl;

        std::cout  << "_QP->PageHeight="<< _QP->PageHeight() << std::endl;


        _QP->SetRenderScale(1.0);

        std::string buf = _QP->RenderPageToString(72, 1 , 5); 




example 2:


- (void)drawRect:(NSRect)dirtyRect

{

    // Drawing code here.

    // Get current context

    CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];

    

    _QP->RenderPageToDC( 72, 1, (int)context);

}



RenderPageToString and RenderPageToDC do not work!

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store