Problem with Image

Hello,

i have a problem with an image in an existing pdf-document. When i am trying to open the document with Aspose.Pdf.Document an embedded image is grey. What have i made wrong?

Greetings

Jens

Hi Jens,


Thanks for your inquiry. Please share your sample code and source PDF document. We will test the scenario at our end and will provide you more information accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hello,

this is the code that i am using:

Private Sub Showpdf()
        Dim lanUser As String = Request.ServerVariables("LOGON_USER").ToLower.Replace("nationalbank.nb\", "")
        Dim newfile As String = AppSettings("serverMappath") & "\anwendungen\Konditionsdatenbank\!Konditionsverzeichnis.pdf"
        Dim outfile As String = AppSettings("serverMappath") & "\anwendungen\Konditionsdatenbank\KondVerzeichnis\Konditionsverzeichnis_" & Session.SessionID & "_form.pdf"
        Dim datei As String
        Dim files() As String = Directory.GetFiles(AppSettings("serverMappath") & "\anwendungen\Konditionsdatenbank\KondVerzeichnis\", "*_form.pdf")
        Dim pdfLicense As Aspose.Pdf.License = New Aspose.Pdf.License
        Dim table As Aspose.Pdf.Table
        Dim row As Aspose.Pdf.Row
    pdfLicense.SetLicense(AppSettings(<SPAN style="COLOR: #a31515">"serverMappath"</SPAN>) & <SPAN style="COLOR: #a31515">"\anwendungen\admin\Aspose.Pdf.lic"</SPAN>)

    <SPAN style="COLOR: blue">Using</SPAN> doc <SPAN style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">New</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">Document</SPAN>(newfile)
        <SPAN style="COLOR: green">' Initializes a new instance of the Table</SPAN>
        table = <SPAN style="COLOR: blue">New</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">Table</SPAN>()
        table.Top = 650
        <SPAN style="COLOR: green">'table.Left = -2</SPAN>
        table.ColumnWidths = <SPAN style="COLOR: #a31515">"600"</SPAN>
        <SPAN style="COLOR: green">' add row to table</SPAN>
        row = table.Rows.Add()
        <SPAN style="COLOR: green">' add table cells</SPAN>
        row.Cells.Add(GetAnsrechpartnerData(lanUser, <SPAN style="COLOR: #a31515">""</SPAN>, <SPAN style="COLOR: #a31515">"nbAnrede"</SPAN>, <SPAN style="COLOR: #a31515">"GivenName"</SPAN>, <SPAN style="COLOR: #a31515">"sn"</SPAN>))
        row = table.Rows.Add()
        row.Cells.Add(GetAnsrechpartnerData(lanUser, <SPAN style="COLOR: #a31515">"Tel.: "</SPAN>, <SPAN style="COLOR: #a31515">"TelephoneNumber"</SPAN>, <SPAN style="COLOR: blue">False</SPAN>))
        row = table.Rows.Add()
        row.Cells.Add(GetAnsrechpartnerData(lanUser, <SPAN style="COLOR: #a31515">"Fax.: "</SPAN>, <SPAN style="COLOR: #a31515">"FacsimileTelephoneNumber"</SPAN>, <SPAN style="COLOR: blue">False</SPAN>))
        row = table.Rows.Add()
        row.Cells.Add(GetAnsrechpartnerData(lanUser, <SPAN style="COLOR: #a31515">"E-Mail.: "</SPAN>, <SPAN style="COLOR: #a31515">"Mail"</SPAN>, <SPAN style="COLOR: blue">False</SPAN>))
        row = table.Rows.Add()
        row.Cells.Add(GetAnsrechpartnerData(lanUser, <SPAN style="COLOR: #a31515">""</SPAN>, <SPAN style="COLOR: #a31515">"StreetAddress"</SPAN>, <SPAN style="COLOR: blue">False</SPAN>))
        row = table.Rows.Add()
        row.Cells.Add(GetAnsrechpartnerData(lanUser, <SPAN style="COLOR: #a31515">""</SPAN>, <SPAN style="COLOR: #a31515">"PostalCode"</SPAN>, <SPAN style="COLOR: blue">False</SPAN>))

        <SPAN style="COLOR: green">' Add table object to first page of input document</SPAN>
        doc.Pages(2).Paragraphs.Add(table)
        <SPAN style="COLOR: green">' Save updated document containing table object</SPAN>
        doc.Save(outfile)
    <SPAN style="COLOR: blue">End</SPAN> <SPAN style="COLOR: blue">Using</SPAN>


    <SPAN style="COLOR: blue">For</SPAN> <SPAN style="COLOR: blue">Each</SPAN> datei <SPAN style="COLOR: blue">In</SPAN> files
        <SPAN style="COLOR: blue">If</SPAN> DateDiff(<SPAN style="COLOR: #2b91af">DateInterval</SPAN>.Day, <SPAN style="COLOR: #2b91af">File</SPAN>.GetCreationTime(datei), Now.Date) <> 0 <SPAN style="COLOR: blue">Then</SPAN>
            <SPAN style="COLOR: #2b91af">File</SPAN>.Delete(datei)
        <SPAN style="COLOR: blue">End</SPAN> <SPAN style="COLOR: blue">If</SPAN>
    <SPAN style="COLOR: blue">Next</SPAN>

    Response.Clear()
    Response.ContentType = <SPAN style="COLOR: #a31515">"application/pdf"</SPAN>
    Response.AddHeader(<SPAN style="COLOR: #a31515">"Content-disposition"</SPAN>, <SPAN style="COLOR: #a31515">"inline; filename=output.pdf"</SPAN>)
    Context.Response.TransmitFile(<SPAN style="COLOR: #a31515">"/anwendungen/Konditionsdatenbank/KondVerzeichnis/Konditionsverzeichnis_"</SPAN> & Session.SessionID & <SPAN style="COLOR: #a31515">"_form.pdf"</SPAN>)
    Response.End()
<SPAN style="COLOR: blue">End</SPAN> <SPAN style="COLOR: blue">Sub</SPAN></PRE>

The pdf-document is attached.

Greetings

Jens

Hi Jens,


Thanks for sharing your source document. I am afraid I am unable to test your scenario with latest version of Aspose.Pdf for .NET i.e 9.2.0. I am getting an exception, ArgumentException, at save method also logged it as PDFNEWNET-36871 in our issue tracking system for further investigation and resolution.

Please confirm which API version you are using, it will help us to investigate the issue.

We are sorry for the inconvenience.

Best Regards,

Hello,

i was using the 8.2.0 version.

Greetings

Jens

Hi Jens,


Thanks for your feedback. I am afraid I have tested the scenario with Aspose.Pdf for .NET 8.2.0 and unable to notice any issue. We will appreciate if you please share a sample console application to replicate the issue as your code has some missing references.

Using doc As New
Aspose.Pdf.Document(myDir + “!Konditionsverzeichnis.pdf”)<o:p></o:p>

' Initializes a new instance of the Table

Dim table = New Aspose.Pdf.Table()

table.Top = 650

'table.Left = -2

table.ColumnWidths = "600"

' add row to table

Dim row = table.Rows.Add()

' add table cells

row.Cells.Add("nbAnrede")

row = table.Rows.Add()

row.Cells.Add("TelephoneNumber")

row = table.Rows.Add()

row.Cells.Add("FacsimileTelephoneNumber")

row = table.Rows.Add()

row.Cells.Add("E-Mail")

row = table.Rows.Add()

row.Cells.Add("StreetAddress")

row = table.Rows.Add()

row.Cells.Add("PostalCode")

' Add table object to first page of input document

doc.Pages(2).Paragraphs.Add(table)

' Save updated document containing table object

doc.Save(myDir + "!Konditionsverzeichnisout.pdf")

End Using

Please feel free to contact us for any further assistance.


Best Regards,

Hello,

i have used another Adobe Acrobat Reader without the problem.
So it is a probelm with the Adobe Acrobat Reader i used (V9.2.0) and not with Aspose.NET.
Sorry.

Best Regards

Jens

Hi Jens,


We are pleased to hear that you have managed to figure out the reasons of this problem. In the event of any further query, please feel free to contact.

Hi Jens,

Thanks for your patience.

We have further investigated the issue reported earlier and it does not seem to be an issue with Aspose.Pdf for .NET. The metadata contains the invalid string xapMM:DocumentIDuuid:099b3841-d433-11e3-0000-0052a158b7aX{}�c</xapMM:DocumentID> in input file. It’s Ghostscript 9.04 bug (http://bugs.ghostscript.com/show_bug.cgi?id=692268), the user should update to later version of GS.

Furthermore, as per our observations, we cannot find xapMM:DocumentIDuuid:099b3841-d433-11e3-0000-0052a158b7aX{}�c</xapMM:DocumentID>

in attached file. I see this content :

<rdf:Description rdf:about=’’ xmlns:xapMM=‘http://ns.adobe.com/xap/1.0/mm/’ xapMM:DocumentID=‘uuid:099b3841-d433-11e3-0000-0052a158b7aX{}рc’/>

, that is OK from the point of view of http://bugs.ghostscript.com/show_bug.cgi?id=692268 .

The presentation of DocumentID may differ in viewers. Please read this discussion topic http://ghostscript.com/pipermail/gs-bugs/2011-December/023791.html . The reason of the issue is - “In both Linux and Windows 9.04 versions of ghostscript, the generated UUID seems to be malformatted, resulting in an invalid XMP metadata package.”. This document was produced exactly by GPL Ghostscript 9.04 (please take a look the value of PDF Producer field in Document properties). The well formatted of DocumentID string in Metadata should be like xapMM:DocumentIDuuid:b78c3d11-fa55-4d68-beb3-2ae690a27017</xapMM:DocumentID>.

Conclusion

It looks like document contains problem described in articles specified on above stated URLs. So the issue seems to be in Ghostscript 9.04б not in Aspose.Pdf and should be closed a ‘NotABug’.