Rotate BMP image in PDF Editor Toolkit SDK product

I have enjoyed using your pdf toolkit for c++ for a while, but am stuck on a problem I have. When I put a bmp image from a file into a pdf I can place it where I want, but I don?t see how to rotate it. Please tell me how to rotate an image.
==============================
PDF Editor Toolkit hasn't an option to rotate the BMP image, you need rotate image by yourself, and then insert the image data into PDF page.

VeryPDF
==============================
I program in C++ Borland 5.0. If you can write a program that rotates a bmp file, that would be great.
==============================
Thank you for your quick response. Will this bmp file image rotation function allow me to rotate a bmp file to make another bmp file that is rotated? If so, then I agree. I would like to rotate the image file itself as you first suggested I do so that I can use your other functions on the file as is.

So specifically it would be nice to have a function written in C that takes as its input the input filename, the output filename and the rotation amount in degrees. I know this is standard in windows, but I have been having trouble getting the time to write it.

For example: rotatebmpf(char * inputfn, char *output, short degrees)

Thank you.
==============================
Yes, you are right, this function will rotate BMP to a new BMP first, then you can insert the rotated BMP file into PDF file again, we will implement following function to you,

BOOL RotateBmpFile(char * inputfn, char *output, short degrees)

VeryPDF
==============================
This will save me time. Its your area of expertise. So you are the best person doing this.
==============================
Thanks for your message, we have finished this function to you, please download the new test package from following URL,

XXXXXXXXXXXXXXXXXXXX

After yo download and unzip it to a folder, you can call RotateImageFile() function to rotate the BMP file, this function is support TIFF, JPG, PNG, PCX, TGA, GIF, etc. image files too.

If you encounter any problem with this function, please feel free to let us know, we are glad to assist you asap.

VeryPDF
==============================
Thank you for adding to your product the ability to rotate an image. I was wanting to have the standard windows C code to rotate an image. This function is built into the verywrite.dll but I don’t see the C code for the rotate that I asked for. I want to rotate the image in my C code. The verywrite.dll is used only in the pdf routines. If you can only provide it for bmp files that is ok because that is what I asked for. It is nice to be able to rotate jpgs etc, but I need to rotate a bmp file.
==============================
Please refer to attached C code, you can use this C code to rotate a BMP file without any problem.

VeryPDF
==============================
This is still inside the verypdf dll.

I was requesting a standard windows C program, not a program with any dependencies. For example, BitBlt() puts a bitmap on a dc. StretchDIB() puts a scaled bitmap on a dc. I was going to write the bmp file rotation function with the Xform functions, but I figured you’d be better and quicker than me. It doesn’t have to be the Xform functions, just standard windows api or standard C is fine. Win32 C functions are standard and can be compiled easily into my project. Can you do this?
==============================
Okay, we have write a new source code to you, please refer to this source code file in attachment.

This rotatebmp.cpp file can be compiled and run without any problem in VC++ 6.0.

VeryPDF
==============================
Thank you. It rotates the bmp file nicely. Great work !

I am now trying to put the image on the pdf where I want it.  But it is not moving to the x and y coordinates I want. Here’s my program trying to put it where I want:

void pdfimageout(char gpfn[256],long gpxPos,long gpyPos)
{
char szImageFile[256];
char buf[32];
char buf2[32];

if(access(gpfn,0)==0)
{
GetModulePath(szImageFile,gpfn);

//moves and scales image.
pVerySetFunction(pdfid,Very_Set_ImagePosAndSize,
gpxPos,-gpyPos,
ltoa(gpxPos,buf,10),ltoa(-gpyPos,buf2,10));

pVeryAddImage(pdfid,szImageFile);
}

}

If I do not use the pVerySetFunction(pdfid,Very_Set_ImagePosAndSize function, it comes out perfectly scaled but at the top left of the image.

If I use the pVerySetFunction(pdfid,Very_Set_ImagePosAndSize function,, the image comes onto the page tall and thin and way away from the x,y I want it. Is there a scale I need to use?
==============================
We noticed the width and height parameters are wrong in your code, please use following code to try again,

pVerySetFunction(pdfid,Very_Set_ImagePosAndSize,    gpxPos,-gpyPos,  ltoa(gpxPos+500,buf,10),ltoa(-gpyPos+500,buf2,10));

VeryPDF
==============================
Thank you,

I had my x and y positions backwards.

Thank you.

BTW Do you do any other kinds of programming? I know you are very good with graphics.  Any other areas of programming you like to do?
============================
Thanks for your message, yes, we can provide other graphics and document formats conversion or processing development service, please feel free to email to us your detailed requirement, then we will figure out a solution and quotation to you asap.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!