Image Extraction - Images Rotated and Inverted

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
neilpitman
User
Posts: 39
Joined: Fri Jun 17, 2005 8:38 am

Image Extraction - Images Rotated and Inverted

Post by neilpitman » Tue Sep 27, 2005 8:00 am

Attempting to extract an image with PDFXCp_SaveImageFromPage etc from the attached sample PDF results in an image file which appears to be inverted and rotated 90 degrees from the PDF original. This is true using the SDK examples (saveimagesfrompdf, imagefrompdf) or our own app.

Any workaround would be appreciated.
Attachments
sample.zip
(919.05 KiB) Downloaded 141 times

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Sep 28, 2005 7:30 pm

Hi Neil,

Images are stored within PDF files in their original state in terms of rotation - irrespective of any subsquent action to rotate them for veiwing purposes - despite the fact they may have been saved to a new orientation within the PDF.

Version 3 offered no means to alter this prior to the file being written on extraction

Using the new Version 3.5 XCPRO35 library you can modify the state of an image on extraction (see PXCp_SaveImageOptions {
) and numerous other properties.

Can you please supply a sample PDF and the extracted image(s) so we can take a look and advise.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

neilpitman
User
Posts: 39
Joined: Fri Jun 17, 2005 8:38 am

Post by neilpitman » Wed Sep 28, 2005 9:02 pm

Hi

A sample PDF file that demonstrates the problem was attached to the original post - if you can't read it for some reason let me know.

Thanks

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Sep 29, 2005 9:57 am

Sorry,

was not clear - what I was after was to see the images and format that you extracted to - and to ascertain what you were aiming for.

Please see attached - the first file extracts as as in the PDF file with no changes made to the images orientation on extraction - they are extracted as they exist within the file itself - not necessarily as they view within the Acrobat Viewer.

The 2nd file is saved re-orientating the files to match the values for viewing - to ensure they are saved on extraction to an image format as they appear in Acrobat viewer - not as they are saved within the PDF file itself.

This was acheived using the new xcpro35 library and the function described previously - also note there is no issue with inverted images.

Is this what you are attempting to achieve and to what format do you wish to extract to - also what development tool are you using ?
Attachments
Neil Pitman.zip
Extracted Images
(1.84 MiB) Downloaded 150 times
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

neilpitman
User
Posts: 39
Joined: Fri Jun 17, 2005 8:38 am

Reply

Post by neilpitman » Mon Oct 03, 2005 1:33 pm

The "correctly" rotated version (ie the way that it appears in Adobe Reader) that you attached is the desired result. We are using PDFXCp_SaveImageFromPage and find that the image is inverted and "incorrectly" rotated (file attached). Do we need to switch to making use of the 3.5 library calls? That may resolve the invert issue, but how can we detect the rotation issue?

Thanks
Attachments
output.zip
(935.61 KiB) Downloaded 137 times

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Mon Oct 03, 2005 1:50 pm

Hi Neil,

Using the 3.5 library is the best way to resolve both issues for you as you have a great deal more control available to you in the extraction formats and properties available - can I ask what dev tool you use and I will ask the relevant dev here for some sample code to detect the orientation as required for the extraction.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

neilpitman
User
Posts: 39
Joined: Fri Jun 17, 2005 8:38 am

Post by neilpitman » Mon Oct 03, 2005 2:02 pm

Hi

For this project we use MS Visual C++ (not .Net) with Visual Studio 2003.

Thanks

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Mon Oct 03, 2005 3:13 pm

Hi Neil,

ok - here is a quick and far from perfect method that will handle only images that exist with an orientation differential between the PDF viewer saved orientation setting and the saved native image orientation - of 90 degrees - but should give you an insight into what is required.

Please see the attached.
Attachments
RotateExtract.zip
simple demo of extract and rotate image to match viewer setttings - not image orientation as saved in a PDF.
(0 Bytes) Downloaded 144 times
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

neilpitman
User
Posts: 39
Joined: Fri Jun 17, 2005 8:38 am

Post by neilpitman » Mon Oct 03, 2005 4:38 pm

Thanks but the zip file was empty! Would you be able to repost?

On a related note, to prep for using the 3.5 interfaces I'm trying to build the C++ TestPro35 sample in build 91. After adjusting for include and lib directories (from ../lib to ../../../lib etc) I found that ixc_c.h, ixcdefs.h, ixcfmtdefs.h were missing (I grabbed them from the 3.0 release?), but then found I get TestPro35 fatal error LNK1104: cannot open file 'ixclib30.lib' presumably from #pragma comment(lib, "ixclib30") in mainfrm.cpp. Can you give a couple of pointers to help build the 3.5 test?

Thanks

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Mon Oct 03, 2005 4:59 pm

Oops - checking on the issue now and will advise - in the meantime here is the empty zip again

thanks for your patience.
Attachments
RotateExtract.zip
Checked zip project
(679 Bytes) Downloaded 142 times
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Oct 04, 2005 3:43 pm

Niel,

the issues in the download you have have been corrected in a revised install now available - but - I should advise you the example provided yesterday to change the orientation of the extracted image to match the Viewer orientation for the image uses functions via the PDF-Tools SDK that also requires the licensing of our Image-XChange SDK to use 'Live'.

I was not aware of this when I provided - apparently this is the most effiecient means to achive this and allows the 2 libraries to work seemlessly together.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply