Loading...

Color changed when creating a PDF from an image

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Color changed when creating a PDF from an image

Postby louis » Thu Aug 13, 2009 4:57 pm

Hi,

I display a pdf file with text in red color. Then, I create a new pdf file from the image which is displayed, with PdfAddImageFromGdPictureImage and PdfDrawImage. The red color in the new file is dark.
Is there a property to use when creating the pdf ?

Louis
louis
 
Posts: 49
Joined: Tue Apr 28, 2009 6:18 pm

Re: Color changed when creating a PDF from an image

Postby Loïc » Thu Aug 20, 2009 9:12 am

Hi,

Could you provide files + code snippet to illustrate your issue ?

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Color changed when creating a PDF from an image

Postby louis » Wed Aug 26, 2009 7:39 pm

Hi,

The pdf files cannot be uploaded, so I send them to the support.
This is the code :

Code: Select all
Private Sub TestGdDarkRedColor()
    Dim w!, h!
    Dim ImageF&
    Dim iFont&, status&
    Dim path$
   
    ' display RedColor.Pdf : no problem
    GDV_File.BackColor = vbWhite
    GDV_File.PdfDpiRendering = 110
    GDV_File.Clear
    GDV_File.CloseImage
    GDV_File.SilentMode = True
    path = "RedColor.pdf"
    status = GDV_File.DisplayFromPdfFile(path)
    h = GDV_File.GetHeightMM / 10
    w = GDV_File.GetWidthMM / 10
   
    GDV_File.SilentMode = False
    GDV_File.SetZoomFitControl
    GDV_File.ContinuousViewMode = False
    GDV_File.MouseWheelMode = 0
   
    ' generate RedColorGd.pdf : red color becomes dark
    path = "RedColorGd.pdf"
    GDI_File.CloseNativeImage
    If GDI_File.PdfNewPdf(path, "", "", "", "") Then
        GDI_File.PdfSetMeasurementUnits (2) ' cm
        GDI_File.PdfSetPageDimensions MWidth / 10, MHeight / 10
        iFont = GDI_File.PdfAddFont("Arial", True)
       
        ImageF = GDI_File.PdfAddImageFromGdPictureImage(GDV_File.GetNativeImage)
       
        GDI_File.PdfNewPage
        Call GDI_File.PdfDrawImage(ImageF, 0, 0, w, h)
        GDI_File.PdfEndPage
       
        GDV_File.Clear
        GDV_File.CloseImage
        GDI_File.PdfSavePdf
     End If
End Sub



Louis
louis
 
Posts: 49
Joined: Tue Apr 28, 2009 6:18 pm

Re: Color changed when creating a PDF from an image

Postby Loïc » Fri Aug 28, 2009 4:35 pm

Hi,

I think you can get pretty similar result with

Code: Select all
GDV_File.PdfDpiRendering = 72


and

Code: Select all
GDI_File.PdfSetJpegQuality (100)


Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

No change !

Postby louis » Wed Sep 09, 2009 12:16 pm

Hi,

There is no change with PdfDpiRendering = 72 and PdfSetJpegQuality (100).

That's strange because the operation I'm making is basic. Did you get the same problem ?

Louis
louis
 
Posts: 49
Joined: Tue Apr 28, 2009 6:18 pm

Re: Color changed when creating a PDF from an image

Postby Loïc » Wed Sep 09, 2009 12:20 pm

Hi Louis,

Keep in mind that you are converting PDF with vector objects to a PDF including only image due to the rasterization process.
Therefore, you will more or less different result depending on the viewer you are using.

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Color changed when creating a PDF from an image

Postby louis » Wed Sep 09, 2009 2:06 pm

Hi again,

I understand what you mean about the conversion but I think that there may be a little problem, or maybe some other properties or methods to use. It's strange that, if we add red text on a white page, then we create the pdf, we display it and we save it again, the simple red color is changed. With Adobe Acrobat for example, there is no change.

Sorry to be insistent ! We would like to develop a perfect tool ! :)

Louis
louis
 
Posts: 49
Joined: Tue Apr 28, 2009 6:18 pm

Re: Color changed when creating a PDF from an image

Postby Loïc » Wed Sep 09, 2009 2:25 pm

Louis your comparison is wrong:

You are comparing what Adobe shows you at screen from a vector document, to this same document rasterized to an image format with dataloss compression (JPEG)


If you want to make a comparison between what Adobe done, please have a look on the attached image. it is your document opened by acrobat and saved as JPEG. As you can see the result is exactly the same as GdPicture.

I done the test with 200 dpi rendering, maybe you should try this value.
Attachments
from-gdpicture.jpg
From GdPicture
from-acrobat.jpg
From Acrobat
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 2 guests

cron