Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Incorrect PDF when JPEG has color space |
Post Reply ![]() |
Author | |
Darlock ![]() Beginner ![]() Joined: 27 Nov 12 Location: Ukraine Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() Posted: 27 Nov 12 at 3:58PM |
Hi!
I have a JPEG image with embeded color space (color profile). When I add the image to the PDF document via Adobe Acrobat - the PDF looks OK. When I add the image using QuickPDF library (see code below) and open the resulting file via Adobe Acrobat afterwards - the image's colors have changed as if there was no color profile. procedure TForm1.btn1Click(Sender: TObject); var ... const ... begin FPictureStream.Clear; FPictureStream.LoadFromFile(vFileName); FPDFLib.NewPage; FPDFLib.DeletePages(1, 1); // Page Properties FPDFLib.SetOrigin(1); FPDFLib.SetMeasurementUnits(1); FPDFLib.SetPageDimensions(210, 270); // Add image vGrProperties.x := 10; vGrProperties.y := 10; vGrProperties.w := 60; vGrProperties.h := 80; vRes := FPDFLib.AddImageFromStream(FPictureStream, 0); vIXR := FPDFLib.ImageVerticalResolution; vIYR := FPDFLib.ImageHorizontalResolution; case FPDFLib.ImageResolutionUnits of 0, 1 : begin vResolutionFactorX := 1; vResolutionFactorY := 1; end; 2 : begin vResolutionFactorX := 1/vIXR * 25.4; vResolutionFactorY := 1/vIYR * 25.4; end; 3 : begin vResolutionFactorX := 1/vIXR * 10; vResolutionFactorY := 1/vIYR * 10; end; end; vWidth := FPDFLib.ImageWidth * vResolutionFactorX; vHeight := FPDFLib.ImageHeight * vResolutionFactorY; vRes := FPDFLib.DrawImage(vGrProperties.x, vGrProperties.y, vWidth, vHeight); Assert(vRes > 0, cnstPlaceGraphicErr); ... if FPDFLib.SaveToFile(vFileName) = 0 then raise Exception.Create(format(cnstUnableSaveFile, [vFileName])); end; ---------------------------------------------- I have an test project on Delphi with testing image, but I don't see how to attach file here |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store