Print Page | Close Window

How can I use RenderPageToDC on Mac?

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=2719
Printed Date: 31 May 25 at 10:07AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: How can I use RenderPageToDC on Mac?
Posted By: Aleksandr
Subject: How can I use RenderPageToDC on Mac?
Date 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?



Replies:
Posted By: Aleksandr
Date 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.



Posted By: Aleksandr
Date 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



Posted By: Aleksandr
Date 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!




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