I don't know how to use the method (PDDrawPageOrCosObjectToBuffer) in the Mac environment.
Use the method of PDDrawPageOrCosObjectToBuffer of Acrobat SDK from DC () in the Mac environment,
I want to get a screenshot of the PDF in the bitmap to the screen.
A description of PDDrawPageOrCosObjectToBuffer () in Acrobat DC SDK API references, but I do not understand how to use the method.
Please tell me this use.
If there is a code example using PDDrawPageOrCosObjectToBuffer (), I'm happy.
Hello
My code is finally working with PDDrawPageOrCosObjectToBuffer. I hope it helps someone:
void releaseBufferForCG (void * / * info * /, const void * data, size_t / * size * /)
{
Free ((void*) Data);
}
CGImageRef CAcrobatBitmapCreator::ConvertToBitmap (const PDPage & i_rPDPage,
ASFixedMatrix & i_rTransform,
int & i_rBitmapWidth,
int & i_rBitmapHeight)
{
Get the rect in user-space coordinates update
ASRealRect updateRectReal = {0,0,0,0};
ASFixedRect boxFixed;
PDPageGetBBox (i_rPDPage & boxFixed);
updateRectReal.top = ASFixedToFloat (boxFixed.top);
updateRectReal.left = ASFixedToFloat (boxFixed.left);
updateRectReal.right = ASFixedToFloat (boxFixed.right);
updateRectReal.bottom = ASFixedToFloat (boxFixed.bottom);
Convert the fixed transformation matrix to real
ASRealMatrix transformReal = {0, 0, 0, 0, 0, 0};
transformReal.a = ASFixedToFloat (i_rTransform.a);
transformReal.b = ASFixedToFloat (i_rTransform.b);
transformReal.c = ASFixedToFloat (i_rTransform.c);
transformReal.d = ASFixedToFloat (i_rTransform.d);
transformReal.tx = ASFixedToFloat (i_rTransform.h);
transformReal.ty = ASFixedToFloat (i_rTransform.v);
ASRealRect destRectReal = {0, i_rBitmapHeight, i_rBitmapWidth, 0}; l, r, t, b
Prepare the buffer for drawing https://forums.adobe.com/thread/1850089
This first call to PDDrawPageOrCosObjectToBuffer is only used to get the size of the buffer.
ASCab flags = ASCabNew();
ASInt32 bitsPerChannel = 8;
ASUns32 bufferSize = PDDrawPageOrCosObjectToBuffer (i_rPDPage,
CosNewNull(),
ASAtomFromString ("DeviceRGB"),
NULL,
NULL,
bitsPerChannel,
flags,
9,
NULL,
& transformReal,
& destRectReal,
& updateRectReal,
NULL,
0,
(NULL);
char buffer = (char *) malloc (bufferSize);
Memset (buffer, 0xff, bufferSize);
Draw in the buffer
ASCabPutBool (flags, kPDPageUseAnnotFacesStr, true);
ASCabPutBool (flags, kPDPageDrawSmoothTextStr, true);
ASCabPutBool (flags, kPDPageDrawSmoothLineArtStr, true);
ASCabPutBool (flags, kPDPageDrawSmoothImageStr, true);
bufferSize = PDDrawPageOrCosObjectToBuffer (i_rPDPage,
CosNewNull(),
ASAtomFromString ("DeviceRGB"),
NULL,
NULL,
bitsPerChannel,
flags,
9,
NULL,
& transformReal,
& destRectReal,
& updateRectReal,
buffer,
bufferSize,
(NULL);
Convert buffer CGImage
// 1. Remove the 4 bytes of padding at the end, in a new buffer.
size_t bytesPerRow = (i_rBitmapWidth * 3);
bytesPerRow = (bytesPerRow % 4 == 0? bytesPerRow: bytesPerRow + (4-(bytesPerRow % 4)));
size_t bytesPerRowForGC = i_rBitmapWidth * 3;
size_t bufferCGSize = bytesPerRowForGC * i_rBitmapHeight;
char * bufferForGC = (char *) malloc (bufferCGSize);
Memset (bufferForGC, 0xff, bufferCGSize);
for (int lineIndex = 0; lineIndex)< i_rbitmapheight;="">
{
char * destGCPtr = bufferForGC + (lineIndex * bytesPerRowForGC);
char * srcPtr = buffer + (lineIndex * bytesPerRow);
If ((srcPtr + bytesPerRowForGC)<= (buffer="" +="" buffersize)="" &&="" (destgcptr="" +="" bytesperrowforgc)="">=><= (bufferforgc="" +="" buffercgsize)="">=>
{
memcpy (destGCPtr, srcPtr, bytesPerRowForGC);
}
on the other
{
break;
}
}
// 2. Create a CGImage using the new buffer.
CGDataProviderRef provider = CGDataProviderCreateWithData (NULL,
bufferForGC,
bufferCGSize,
releaseBufferForCG); Buffer are ions released this reminder
Space color CGColorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGImageRef finalImage = CGImageCreate (i_rBitmapWidth,
i_rBitmapHeight,
bitsPerChannel,
bitsPerChannel * 3.
bytesPerRowForGC,
color, space
kCGImageAlphaNone,
provider,
NULL, / / decode (of remapping the colors)
true, / / interpolate (pixel smoothing)
kCGRenderingIntentDefault);
CGColorSpaceRelease (colorspace);
CGDataProviderRelease (provider);
Free (buffer);
FinalImage return;
}
David
Tags: Acrobat
Similar Questions
-
I can't find a newer version of adobe flash player for ubuntu 14.04, I tried to use the apt version but it wouldn't work and I don't know how to use the tar.gz files and install, I think the current version to .deb
Hi LF12,.
The latest version of Flash Player for Linux is 11.2.202.400. The current versions of Flash Player are displayed here http://www.adobe.com/software/flash/about/. The versions on the page are updated with each new version.
--
Maria
-
I DON'T KNOW HOW TO USE THE SCANNER
I HAVE A HP PHOTOSMART 5514 AND HAVE NEVER USED THE SCANNER. I NEED TO KNOW WHERE TO INSERT THE DISK MEMORY.
Thank you
You have solved my problem. Thank you very much.
-
I use Hotmail on a new Mac and don't know how to increase the font size for the display of my email. you use the zoom + is only one temp. Suggestions please.
According to the format your help,.
Hotmail format,
Click Options at the top right,
Then more options.
Writing e-mail / click on fonts and signatures.
Make you choices and save.
New format for Outlook.com,
Click on the gear in the top right, symbol
Click Options,
The options are almost the same.
For more entries change your question and move it to the section of Hotmail, Messenger, and skydrive.
Search by all subjects,
Section Outllook.com or hotmail.com.
-
I have paid the monthly fee and have been using Acrobat Pro DC. I had a problem where I broke my previous laptop and want to continue to use this product. I bought another laptop, and I don't know how to download the program without having to pay again. I pay $14,99 per month for this service, how can I download it without having to pay again?
Hello
Please download Acrobat Pro ms of the here. After you download the application, install and activate it by providing your Adobe ID
Thank you
Abhishek
-
Don't know how to read the results of netstat EI s list? If I received 860592506 bytes sent from 43421482 how to convert MB? And does this mean byte received?
Hello
This shows the total number of bytes transmitted and received via the Ethernet card. This is the total of the amount of use up to this day.
This includes all the Web sites you have visited and emails you sent, etc..
You can calculate using one of the following methods:
Method 1:
860592506 / 1048576 = 820,72 MB
Method 2:
Multiply 860592506 with 9.53674316 * 10 ^-7 that will give us the result in mega bytes.
860592506 bytes = 820 MB 9MB not, accept my apology for the miscalculation.
Similarly 43421482 acroos = 40MB -
My laptop has webcam capabilities, but I don't know how to use or what program to use.
My laptop has webcam capabilities, but I don't know how to use is or what program to use, and I can't find anything in a search.
Hi Marie summers.
See your owner's manual; Contact the manufacturer; or post your computer type and operating system, so we can help you.
-
I don't know how to download the new msn Messenger.
I don't know how to download the new msn Messenger, whenever I download it go back mode. and do not have to install the program this is happing to 4 on my computer and won't let me use msn messenger I have there say this update is done I need a fix.this is by Microsoft live essentials download
Start here: http://explore.live.com/windows-live-messenger
You will find support for Windows Live Messenger in these forums: http://windowslivehelp.com/forums.aspx?productid=2
-
I don't know how to change the size and quality of the text on the screen on Windows 7
I just installed a new Windows 7 but I don't know how to change the size and quality of the text on the screen. I tried all the things normal, resolution, size of icons, dpi etc but nothing gives me what I want. The text in clear 'wonderful' thing is just terrible. When I go through the 4 steps I see no text boxes which make the text nothing better. All options are terrible, so the result on screen is too terrible. When I do any huge I do not get a full screen of things - view the Start button disappears or I did not closing small cross at the top - of the suggestions to inprove the situation? I must mention that my screen/monitor is 2006 - I need to buy a new one? How much is this Windows 7 is going to cost me, or maybe I should go back to XP!
I sincerely thank all you smart "technicians" for all the answers you always gave myself and all others who ask questions. I'm not too smart with all this new technology as I fell into it very late. I am now in my 60s and only started using a pc when I was over 50 years so... In any case, I asked a question about the size of screen resolution and text and received much good advice from all that you guys. I had recently changed in XP to Windows 7. However, the bit of advice that I was given in 'Cyberking' here at the Portugal had set the resolution of the screen, the advanced settings, 75 to 60 Hertz Monitor tab. Very basic, and the first question asked the technician (Lady) was "what size is your screen? Naturally as a smaller screen that any 'techno' would be considered dead aid, solving the problem was simple and straightforward without me having to stretch my knowledge and my skills by downloading all programes weird (to me) or do the funny stuff in the bios or something else. I send this comment to you for you to realize that the simple solution is not always bad and maybe we should go for the easiest first and then work up to the more difficult ones.
Just for you all to see - now my screen resolution is perfect, the text on the screen is clear and legible without difficulty, even though the size of text and icon is small. Clarity is all!
Thank you all once again! Best regards, Blondie blue.
-
Hello, I subscribed to photoshop cc and I used photoshop on my laptop (pc) now, I got a laptop (pc) news and I don't know how to use it on my new computer...
help please!
You can have the creative cloud installed and signed in on two computers as long as you don't use it on one at a time. Download and install as you did on the first computer, sign in to your Adobe account on the Adobe using your Adobe ID website, download the desktop app from clouds, then download the software.
You can download the installer for Creative Cloud from here:
Creative cloud help | Creative cloud desktop.After you install the creative Cloud desktop application, you will need to sign in with a login password and Adobe. Then you can install applications. This link provides more information and step by step instructions, if you need: CC help | Download, install, update or uninstall applications
If you get a new computer, simply log out of creative cloud over one of the other and log on to the new. Connect, disconnect you and | Adobe Creative Cloud desktop app
Guinot
-
I have a LOV custom, but I don't know how to recover the selection?
Hi all
I want to recover my lov user selection, but I don't know much about the syntax.
Please advice.
Currently, I have attached a script to a button so that I can bring out a LOV.
______________________________________________________________
DECLARE BOOLEAN a_value_chosen;
BEGIN
Message ("LOV is gg to pop up.");
a_value_chosen: = Show_Lov ('LOV27');
IF this is a_value_chosen
Message ("you have not selected a value.");
Bell; RAISE Form_Trigger_Failure;
ON THE OTHER
/ * I don't know how to recover the selection of the user here... * /.
Message ("you selected a value!' |") SELECTION);
END IF;
END;There is another way to get your selection of LOV... you can not use this concept...
You must return value LOV to some parameter/item, while creating LOV. in order to check if its recoveries or not...Suppose that you have returned the value to a parameter named RETURN_VAL then...
DECLARE A_VALUE_CHOSEN BOOLEAN; BEGIN MESSAGE('LOV IS GG TO POP UP.'); A_VALUE_CHOSEN := SHOW_LOV('LOV27'); IF :PARAMETER.RETURN_VAL IS NOT NULL THEN MESSAGE('YOU HAVE NOT SELECTED A VALUE.'); BELL; RAISE FORM_TRIGGER_FAILURE; ELSE MESSAGE('YOU HAVE SELECTED A VALUE!!!' || :PARAMETER.RETURN_VAL); END IF; END;
-Aamir Arif
-
Hi, after you install Minecraft in my iMac, I get this message: "cannot start minecraft, if you run from a dmg, please drag applications and try again. I Don t know how to start the game. Thank you
So what measures through 'install '?
-
My messages send and receive txt messages not iMessage on my iPhone and I don't know how to solve the problem to send and receive messages as iMessage
Settings > messages > iMessage turn off then turn it back on...
If it does not sign of your apple under messages ID. Settings > General > reset > reset all settings (will not erase data).
Then log in messages
-
Does anyone know how to use the HP Deskjet F4580 wireless printer
Does anyone know how to use the HP Deskjet F4580 wireless printer
Do you have a specific question or just general knowledge?
The manual is available online here.
-
I am runing vista and do not know how to use the fax machine
I am runing vista and do not know how to use the fax machine
Here's how to set up Windows Fax and Scan: http://windows.microsoft.com/en-us/windows-vista/Set-up-your-computer-to-send-and-receive-faxes. Navigate the reference links on the right for more information on how to send faxes and other information. If you do this on every page you just, you can see all the articles on how to fax and scan and configure the system and solve problems, and many other subjects that may be necessary, useful or informative. After that, you must be an expert on this subject.
Here is a quick and easy way to send a fax in Vista: http://www.ehow.com/how_2029566_send-fax-vista.html.
Unfortunately, the foregoing is available in Business, Enterprise, and Ultimate - not Basic or Home Premium. In the latter, you need a 3rd party program. If this is the case, here are some options:
With the compliments of Bob F. http://www.vistax64.com/vista-print-fax-scan/127986-how-do-i-download-windows-fax-scan.html:
Not available in Vista Home Premium Basic FAX. It is available in complete edition,
Extreme and business.You might want to consider Snappy Fax at a low cost:
http://www.snappysoftware.com/or the free version of BVRP:
http://www.usr.com/BVRP/bvrp.aspor a full BVRP Classic Phone Tools 9: $29.90
http://www.shop.Avanquest.com/USA/PR...S_CPT_homepageLook screen kinda gross but the product Snappy fax
actually, is quite rich in features and works very well. BVRP also works very well,
screen looks a bit better. Other that that, there are minor differences
performance between the two.I hope this helps.
Good luck!
Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.
Maybe you are looking for
-
by example, if I type 'f' in where I went looking for a Web site, and when I type that facebook letter arrives, how can I get rid of this if nothing appears until I hit the whole site?
-
Pages pull up of certain documents and States "it cannot be opened for some reason any."
I use the Pages more up-to-date on my macbook, but whenever I have pull up some documents, he says that he cannot find it for some reason any? I had no problem before, but all of a sudden does not work?
-
Hi, see more % of zoom in the bottom right of my screen, and I need for these ole eyes
-
What does the message "error during loading, the specified module is not found means?
The message I receive when I connect to my computer. (1) could not load or run C/Julia/App.Data/Local/Temp/Csrss.exe'Specifed in the registry. Make sure that the file exists on your computer or remove the reference to it in the registry. (2) RunDLL
-
hpqusgl.exe does not allow me to print from the web?
I get this message whenever I try to print from the web on my old purchase of a Laserjet P2055dn 3 day... "" A website wants to open web content using this program on your computer "allow or do not allow. I say let despite this, I see that "this prog