PDPageDrawContentsToMemory for SDK 7.0.5?

Hi,
I want to save a single page with my plugin to an Image Format. I am already using CxImage to do so for selected Images in the Document, but now I also want to save the whole Page as shown in Acrobat to a jpeg file. I couldn't find very much Information on that issue unfortunatelly, especially for the SDK 7.0.5. With a function that gives me the Page as Image data which I can process with my Image Library I would be helped. Can anyone tell me?
Greetings,
Sebastian

Hi and thank you,
I tried that, but as I want to draw to the DC I pass NULL for the window parameter in PDPageDrawContentsToWindow.
But I get the Error "Creation of a raster port failed." What does that mean?
My Code looks now like this:
HDC memhdc = CreateCompatibleDC(NULL);
ASFixedMatrix thematrix;
PDPageGetFlippedMatrix(thepage, &thematrix);
ASFixedRect thecropBox;
PDPageGetCropBox(thepage, &thecropBox);
HBITMAP hbmp = CreateCompatibleBitmap(memhdc,thecropBox.right * 300 / 72,thecropBox.bottom * 300 / 72);
SelectObject(memhdc, hbmp);
PDPageDrawContentsToWindow(thepage, NULL, &memhdc, false, &thematrix, &thecropBox, NULL, NULL);
What's wrong with that?
Sebastian

Similar Messages

  • Tips and Tricks on optimizing your app for SDK 2.6

    If there is a thread like this I apologize for starting another one.
    The result from SDK 2.6 was a shellshock for me, but then again, it brings back the old days when I first struggled with the first version of the Flash Packager.
    I hope that we can put all our ways of optimizing apps for SDK 2.6 here.
    I do not claim superior knowledge, just what I have experienced from my own usage.
    Here’s mine [for now]:
    1: Do not use cacheAsBitmap and cacheAsBitmapMatrix when publishing using CPU.
    If your app uses iPhone/iPad combinations, this option will F you up.
    The size of the button will be wrong and all your wonderful "cached in the wrong resolution" size crap [Which shouldn’t happen because cache IS suppose to be a good thing, but SDK 2.6 doesn’t "always" work here for now, now I am not saying that it doesn't work, I am saying that upon certain unpredicatble refresh senerios you might see [I know I have] your buttons or graphics changed size upon redraw.]
    2: Do not use cacheAsBitmap and cacheAsBitmapMatrix in when publishing using GPU.
    Yes you heard that right; because the app will be slow slow slow.
    Basically SDK 2.6 renders these two options [cacheAsBitmap and cacheAsBitmapMatrix] completely useless and in many cases detrimental.
    The very key thing that speeds up apps in older version of the Flash packager is now the slo-mo dragger in the new SDK.
    What then do we use you ask ?
    I ask that question myself.
    But now we have new APIs!
    3: Approaching this new version of the SDK.
    I personally would suggest using this 2.6 SDK as a stepping stone to learning the new APIs but do not use it for actual app publishing unless you really need the multi-task.
    The speed problem will render your app professionally unusable for users comfortable with the reactionary speed of typical iPhone/iPad apps that even older version of the Flash packager can achieve if cacheAsBitmap and cacheAsBitmap matrix are used properly.
    Any more tips to share ?

    TIP: Just have a single ENTER_FRAME listener and add other listeners in a Vector. Example:
    public var enterFrameCallbacks : Vector.<Function>;
    public function initEnterFrameCallbacks():void {
         enterFrameCallbacks = new Vector.<Function>();
         stage.addEventListener( Event.ENTER_FRAME, fireEnterFrameCallbacks, true );
    public function addEnterFrameCallback( callback : Function ):void {
         enterFrameCallbacks.push( callback );
    private function fireEnterFrameCallbacks( e : Event ):void {
         e.stopImmediatePropagation();
         var i : uint;
         for (i = 0; i < enterFrameCallbacks.length; i++) {
              if (enterFrameCallbacks[i] != null) enterFrameCallbacks[i]();
    this is just a simple (untested) example.  Tips to make it even better:
    1) Store callbacks as linked list (faster traversal) instead of vector
    2) Add a 'remove' function
    3) Check for duplicates (if this is going to be a problem)
    4) Pass parameters to the callback (such as dt - or time since last frame)
    5) Implement this handler as a singleton, or a series of static methods, to allow easy access from anywhere
    Note that you may run in to problems with this code if:
    1) One of the callbacks removes itself or another callback from the list (because the vector changes as it is being traversed in the loop)

  • [svn] 2312: CursorManager: New functionality and a fix for SDK-15029

    Revision: 2312
    Author: [email protected]
    Date: 2008-06-30 17:24:01 -0700 (Mon, 30 Jun 2008)
    Log Message:
    CursorManager: New functionality and a fix for SDK-15029
    * NEW: When the mouse leaves a window/stage where a cursor is set, the cursor no longer sits on the edge of the screen until the mouse comes back into the window, it disappears.
    * NEW: In AIR, when the mouse leaves an active window and glides over an inactive window (without giving it focus) where a cursor is set, the system pointer will be hidden and the custom cursor will appear while gliding over that window, and disappear when you leave that window.
    * FIX: When a cursor is set in a child Window, and the mouse moves over another Window or WindowedApplication, the cursor no longer disappears -- the correct system pointer or custom cursor will display.
    * Fixed listener leaks when switching systemManagers (neither Jason nor I can tell when/why it would happen in CursorManager, however).
    Reviewer: Jason
    Bugs: SDK-15029
    Doc: No
    QA: Yes, here's an exhaustive list of ideas:
    * We'll need tests for the new behaviors.
    * For all tests, we need to try behavior in air AND behavior in (sa)player, and test regressions.
    * Please test SDK-15583 again, all other cursor tests.
    * Take the test case for SDK-15029 and open up TWO MyWindows. Test how the cursors change across all three app windows when they are overlapped like a Venn diagram, with different combinations of custom cursors on and off -- we should have test cases for all of this behavior.
    * Test that custom cursors work properly when the mouse leaves a non-rectangular stage with transparency.
    * Test mouse drag situations -- drag off stage, release, move back to stage; drag off and back onto stage, etc.
    * In my tests, I found a lot of bad behavior in AIR, and player seemed to be fine. Do we have drag and drop use cases for AIR with custom cursors?
    A list of some bugs I encountered:
    * BUG (cosmetic): If the mouse is outside the stage when a cursor changes for the first time (say you toggle a checkbox which sets the cursor using the keyboard), the cursor will appear on the stage in the last known mouse position. When the mouse returns to the stage, everything will start working correctly again.
    * BUG (cosmetic): In AIR, if you drag out, and back into the window, then release, a MOUSE_OUT is fired again over the stage, which is wrong. The mouse coords given are (-1,-1), also wrong. This causes the system cursor to show instead of the custom cursor.
    * BUG: In AIR: if you drag off the edge of a Window with a custom cursor, the cursor will vanish. The MOUSE_OUT event correctly event fires while dragging off the window. Even though the handler tells the system mouse cursor to appear, it doesn't -- might be an AIR issue, since the mouse is still dragging when told to show. If you move back over the active window without dragging, the cursor goes back to normal.
    * BUG: In AIR: if you drag over another window with a cursor, MOUSE_MOVE events don't fire on that other window until you let go. Therefore, a custom cursor in that window does not get drawn, nor does a system cursor. If you move back over the active window without dragging, the cursor goes back to normal.
    * BUG: In AIR: When dragging, off a window, Event.MOUSE_LEAVE only fires after the mouse is let go (unlike MOUSE_OUT), EVEN IF the mouse is dragged back over the window and released over the window. So you're told the mouse left when it didn't.
    * BUG: In Player: I could never get Event.MOUSE_LEAVE to fire when added to the stage in saplayer or browser.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15029
    http://bugs.adobe.com/jira/browse/SDK-15029
    http://bugs.adobe.com/jira/browse/SDK-15583
    http://bugs.adobe.com/jira/browse/SDK-15029
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.a s

  • [svn] 3668: Fix for SDK-15941: selectedItem/ selectedIndex does not render as selected.

    Revision: 3668
    Author: [email protected]
    Date: 2008-10-15 15:25:04 -0700 (Wed, 15 Oct 2008)
    Log Message:
    Fix for SDK-15941: selectedItem/selectedIndex does not render as selected.
    Reviewer: Deepa
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15941
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as

    This bug figures out also when creating a custom spark ComboBox, then trying to programatically update the userProposedSelectedIndex property. The proposed selected index is selected, but does not apply the same skin as when mouse is on rollover or item is selected due to up and down keys.
    The issue seems like updating the status of the item renderer to rollover or selected to get the same skin applied.
    Please could you attach DropDow nList.as that you edited ?
    Thank you so much.

  • [svn] 3390: Fix for SDK-17067 - @exampleText does not work in mxml comments

    Revision: 3390
    Author: [email protected]
    Date: 2008-09-26 15:08:34 -0700 (Fri, 26 Sep 2008)
    Log Message:
    Fix for SDK-17067 - @exampleText does not work in mxml comments
    Fix for SDK-17076 - Mxml component with id but no mxml comment is not added to generated document
    QA: Yes
    Doc:
    Reviewed By: Pete
    Tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17067
    http://bugs.adobe.com/jira/browse/SDK-17076
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java

    Wow, that's an interesting one - seems as though the sharedCursorPane has
    some hard requirement that the base App be mx (this isn't terribly
    surprising, considering it was built with the mx components, but it's still
    a bug). Can you link against the source code (provided for player 10 now!),
    and change that line in sharedCursorPane :
    From :
    Application(mx.core.Application.application).stage.removeEventListener(Mouse
    Event.MOUSE_MOVE, onMouseMove);
    To :
    stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
    and see if that works for you? I can't honestly tell why we're using the
    line that was there... It's possible this was a workaround for another
    issue. Anyhow, if you wouldn't mind being the guinea pig for this one, we
    can get to the bottom of it.
      thanks!
       nigel

  • Looking for sdk programmer (ocr) ?

    hi looking for sdk programmer to create extraction tool to extract text from pdf with some additional features. please replay asap.
    regards
    ramnl

    Hi Antonio,
    You may check this: work from home
    Thanks,
    Gordon

  • [svn] 3403: Fix for SDK-17097 - Missing summary description of a class in package classes table

    Revision: 3403
    Author: [email protected]
    Date: 2008-09-29 12:36:37 -0700 (Mon, 29 Sep 2008)
    Log Message:
    Fix for SDK-17097 - Missing summary description of a class in package classes table
    QA: Yes
    Doc:
    Tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17097
    Modified Paths:
    flex/sdk/trunk/asdoc/templates/class-files.xslt

    Well, it's kind of logical that as you put more jar files (classes) in Tomcat, it changes the error to ask for the classes (inside a jar) it cannot find.
    There was a good class->jar finder on the internet some years ago, but i don't remember the address. Try looking for that and search all the missing classes (NotDefined) and their correspondig jar files.
    Good Luck!

  • Code Samples for SDK programming in Java

    I need a complete set of Code Samples for SDK programming in Java, like the one that is available in VB and .Net.
    For Example, if you look at the following directory of machine where SDK is installed,
    C:\ProgramFiles\SAP\SAP Business One SDK\Samples\COM DI\VB.NET
    we have following Sample programs in C Sharp, VB6, VB.Net
    01.BasicOperations
    02.MetaDataOperations
    03.UsingSBObob
    04.SerialAndBatch
    05.OrderAndInvoice
    06.ObjectsSchemas
    07.Permissions
    08.LoadFromXML
    09.BudgetEditor
    10.Messages Service
    11.Basic Company Settings
    12. Report Layout Service
    13.SaveXML
    14.ItemCycleCount
    15.ApprovalStagesAndTemplateServices
    16.Alert Management Service
    Iam looking for Samples like what is available above so that we can understand JCO better.

    Hi Sridharan,
    The only JCO samples I know of are posted in the [thread|;.
    Regards,
    Vítor Vieira

  • [svn:fx-trunk] 15108: * Merged the fix for SDK-24472 from the sherlock sandbox to trunk.

    Revision: 15108
    Revision: 15108
    Author:   [email protected]
    Date:     2010-03-29 09:22:20 -0700 (Mon, 29 Mar 2010)
    Log Message:
    Merged the fix for SDK-24472 from the sherlock sandbox to trunk.
      This includes revisions 14005 and 14621.
    QE notes:
    Doc notes:
    Bugs: SDK-24472
    Reviewer: Tom H., Pete F.
    Tests run: passed full cyclone in sherlock and checkintests in trunk
    Is noteworthy for integration: yes, should reduce memory use in FB.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24472
        http://bugs.adobe.com/jira/browse/SDK-24472
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerSwcContext.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/io/InMemoryFile.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/io/VirtualZipFile.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/MovieTranscoder.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/Swc.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcAPI.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcCache.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcDirectoryArchive.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcDynamicArchive.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcLazyReadArchive.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcLibrary.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcScript.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/Library.java
    Property Changed:
        flex/sdk/trunk/

  • [svn:fx-3.x] 5572: Submit patch on behalf of George Iosif for SDK-18928.

    Revision: 5572
    Author: [email protected]
    Date: 2009-03-26 07:56:49 -0700 (Thu, 26 Mar 2009)
    Log Message:
    Submit patch on behalf of George Iosif for SDK-18928.
    *Modified patch to match Flex coding standards.
    *Added ASDoc for IResourceManager.unloadResourceModule().
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-18928
    Reviewer: Gordon
    tests: checkintests, mustella resource/ResourceManager
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18928
    http://bugs.adobe.com/jira/browse/SDK-18928
    Modified Paths:
    flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/resources/IResourceManager.as
    flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl. as

  • [svn] 3793: Alpha checkin - checking this in on behalf of Paul a fix for SDK-17698.

    Revision: 3793
    Author: [email protected]
    Date: 2008-10-21 13:25:39 -0700 (Tue, 21 Oct 2008)
    Log Message:
    Alpha checkin - checking this in on behalf of Paul a fix for SDK-17698. Paul's change now means advanced CSS functionality is available by default and -keep no longer needs to be specified.
    QE: Yes
    Doc: No
    Checkintests: Pass
    Styles Mustella Tests: Pass
    Reviewer: Pete
    Bugs:
    SDK-17698 - [Advanced CSS] You need to compile with -keep to get Advanced CSS to work (because of direct AST generation)
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17698
    http://bugs.adobe.com/jira/browse/SDK-17698
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java

    I removed the src/ directory and ran makepkg and it succeeded. Pacman -U kernel.pkg.tar.gz also worked. Now all that's left is rebooting and trying.
    Thanks everyone.
    OK, I guess it's not over yet. I rebooted in the new kernel, but it says it can't find /dev/sda3 (which is my / partition).
    This is my grub entry:
    title Arch Linux Gigamo
    root (hd0,2)
    kernel /boot/vmlinuz26 root=/dev/sda3 ro
    initrd /boot/kernel26-gigamo.img
    Okay well, I didnt realise there was a vmlinux26-gigamo as well. Will see if that fixes it.
    Last edited by Gigamo (2008-03-12 16:53:22)

  • [svn] 3313: Fix for SDK-16981 - @ param tag does not recognize tab character as delimiter between paramName and paramDescription

    Revision: 3313
    Author: [email protected]
    Date: 2008-09-23 10:02:50 -0700 (Tue, 23 Sep 2008)
    Log Message:
    Fix for SDK-16981 - @param tag does not recognize tab character as delimiter between paramName and paramDescription
    QA: Yes
    Doc:
    Tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16981
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

  • [svn] 3652: Fix for SDK-17328 - Package description missing when they' re set using Overviews_Base.xml

    Revision: 3652
    Author: [email protected]
    Date: 2008-10-15 10:18:08 -0700 (Wed, 15 Oct 2008)
    Log Message:
    Fix for SDK-17328 - Package description missing when they're set using Overviews_Base.xml
    Fix for SDK-17185 - Allow HTML chars to be set for footer string
    Fix for SDK-17259 - Exception name missing when generating asdoc with @throw tag
    QA: Yes
    Doc: No
    Tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17328
    http://bugs.adobe.com/jira/browse/SDK-17185
    http://bugs.adobe.com/jira/browse/SDK-17259
    Modified Paths:
    flex/sdk/trunk/asdoc/templates/asdoc-util.xslt
    flex/sdk/trunk/asdoc/templates/package-detail.xslt
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    I believe I have found my solution!
    I can currently boot with my bios in ide mode- but my raid1 mirror is showing as independent drives (c and d)
    I do a simple windows search for winload.exe on the C: drive and get nothing
    that same search on the D: turns up winload.exe all over
    When I look at I my BCD 'device partation=C:'
    shouldnt this be D:?
    If so is this just a simple bcdedit, reboot into the bios, change my bios from IDE mode to RAID mode, save to cmos then, theoretically boot into windows with my raid correct (showing as a singe drive C: )
    Please someone correct me if I am wrong
    C:\>bcdedit
    Windows Boot Manager
    identifier              {bootmgr}
    device                  partition=C:
    description             Windows Boot Manager
    locale                  en-US
    inherit                 {globalsettings}
    default                 {current}
    resumeobject            {8b18c20b-c12d-11db-afc2-ac36bbabc8b2}
    displayorder            {current}
    toolsdisplayorder       {memdiag}
    timeout                 30
    Windows Boot Loader
    identifier              {current}
    device                  partition=C:
    path                    \Windows\system32\winload.exe
    description             Microsoft Windows Vista
    locale                  en-US
    inherit                 {bootloadersettings}
    osdevice                partition=C:
    systemroot              \Windows
    resumeobject            {8b18c20b-c12d-11db-afc2-ac36bbabc8b2}
    nx                      OptIn
    vga                     No
    quietboot               Yes

  • [svn:fx-trunk] 7824: Simple fix for SDK-21480 - Batik reports that the * selector has a null name so we handle this as a special case .

    Revision: 7824
    Author:   [email protected]
    Date:     2009-06-13 11:46:34 -0700 (Sat, 13 Jun 2009)
    Log Message:
    Simple fix for SDK-21480 - Batik reports that the * selector has a null name so we handle this as a special case.
    QE: Yes, this was really a compile time issue rather than a runtime issue.
    Doc: No
    Checkintests: Pass
    Bugs:
    SDK-21480 - Universal selector not applied
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21480
        http://bugs.adobe.com/jira/browse/SDK-21480
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.java

    Try the following changes to the JS file
    Lines 103 and 104 change the values
    this.showDelay = 100; // was 250
    this.hideDelay = 200; // was 600
    Comment out line 286
    Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
    //    return Spry.is.safari && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget));
    Comment out line 366 and add new lines 366 and 367
    var self = this;
    this.addEventListener(listitem, 'click', function(e){self.Click(listitem, e);}, false);
    this.addEventListener(listitem, 'click', function(e){self.mouseOver(listitem, e);}, false);
    //   this.addEventListener(listitem, 'mouseover', function(e){self.mouseOver(listitem, e);}, false);
    this.addEventListener(listitem, 'mouseout', function(e){if (self.enableKeyboardNavigation) self.clearSelection(); self.mouseOut(listitem, e);}, false);
    I have not tested the above changes ontouch screens; they do seem to work Ok on desktops.
    NOTE: Line numbers could be different because of the difference in our versions.

  • [svn] 4766: Fix for SDK-19005.

    Revision: 4766
    Author: [email protected]
    Date: 2009-01-30 11:56:35 -0800 (Fri, 30 Jan 2009)
    Log Message:
    Fix for SDK-19005. Additional Advanced CSS work needed where the universal selector * is the subject and the generated AS class needs to be seen as a valid AS name, so we continue to use global for the type name (but leave * as the subject).
    QA: Yes
    Doc: No
    Checkintests: Pass
    Reviewer: Paul
    Bugs:
    SDK-19005 - Application fails to compile after universal Advanced CSS selectors change
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-19005
    http://bugs.adobe.com/jira/browse/SDK-19005
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java

Maybe you are looking for