We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Certain PDFs not converting correctly- black with lines

I have an issue with certain single page PDFs not converting correctly. They end up black with kind of lines all over them. A few control PDFs render fine with the same code. Something in the PDF? I build a simple test. The 6359.PDF fails while the rest work. I'll attach the images and results. Here is the code:

    Convert1PagePDF("D:\PDFRenderProblem\6359.PDF", "D:\PDFRenderProblem\6359.BMP")
Convert1PagePDF(<span style="color: rgb(163, 21, 21);">"D:\PDFRenderProblem\cameronmoll_bio.pdf"</span>, <span style="color: rgb(163, 21, 21);">"D:\PDFRenderProblem\cameronmoll_bio.BMP"</span>)

Convert1PagePDF(<span style="color: rgb(163, 21, 21);">"D:\PDFRenderProblem\viewpdf.pdf"</span>, <span style="color: rgb(163, 21, 21);">"D:\PDFRenderProblem\viewpdf.BMP"</span>)


    Sub Convert1PagePDF(imageFile As String, outputFile As String)
Dim a As Byte() = My.Resources.Aspose_Total
Dim licPDF As Aspose.Pdf.License = New Aspose.Pdf.License()
Dim memLicense As New MemoryStream(a)
licPDF.SetLicense(memLicense)
    <span style="color: blue;">Dim</span> SourceBinaryData <span style="color: blue;">As</span> <span style="color: blue;">Byte</span>()
    SourceBinaryData = System.IO.<span style="color: rgb(43, 145, 175);">File</span>.ReadAllBytes(imageFile)
    <span style="color: blue;">Dim</span> ms <span style="color: blue;">As</span> <span style="color: blue;">New</span> <span style="color: rgb(43, 145, 175);">MemoryStream</span>(SourceBinaryData)
    <span style="color: blue;">Dim</span> convertPdf <span style="color: blue;">As</span> Aspose.Pdf.Facades.<span style="color: rgb(43, 145, 175);">PdfConverter</span> = <span style="color: blue;">New</span> Aspose.Pdf.Facades.<span style="color: rgb(43, 145, 175);">PdfConverter</span>()
    convertPdf.BindPdf(ms)
    <span style="color: green;">'open document</span>
    <span style="color: blue;">Dim</span> pdfDocument <span style="color: blue;">As</span> <span style="color: blue;">New</span> Aspose.Pdf.<span style="color: rgb(43, 145, 175);">Document</span>(ms)

    <span style="color: green;">'get page collection</span>
    <span style="color: blue;">Dim</span> pageCollection <span style="color: blue;">As</span> Aspose.Pdf.<span style="color: rgb(43, 145, 175);">PageCollection</span> = pdfDocument.Pages

    <span style="color: blue;">Dim</span> resolution <span style="color: blue;">As</span> <span style="color: blue;">Integer</span> = 0

    <span style="color: blue;">If</span> (pageCollection.Count > 0) <span style="color: blue;">Then</span>
        <span style="color: blue;">Try</span>
            <span style="color: blue;">Dim</span> pdfPage <span style="color: blue;">As</span> Aspose.Pdf.<span style="color: rgb(43, 145, 175);">Page</span> = pageCollection(1)
            convertPdf.Resolution = <span style="color: blue;">New</span> Aspose.Pdf.Devices.<span style="color: rgb(43, 145, 175);">Resolution</span>(GetResolution(pdfPage.ArtBox.Width))
        <span style="color: blue;">Catch</span> ex <span style="color: blue;">As</span> <span style="color: rgb(43, 145, 175);">Exception</span>
            convertPdf.Resolution = <span style="color: blue;">New</span> Aspose.Pdf.Devices.<span style="color: rgb(43, 145, 175);">Resolution</span>(72)
        <span style="color: blue;">End</span> <span style="color: blue;">Try</span>
    <span style="color: blue;">End</span> <span style="color: blue;">If</span>

    convertPdf.StartPage = 1
    convertPdf.EndPage = 1

    convertPdf.DoConvert()

    <span style="color: blue;">Dim</span> b <span style="color: blue;">As</span> <span style="color: blue;">Byte</span>() = <span style="color: blue;">Nothing</span>
    <span style="color: blue;">If</span> convertPdf.HasNextImage() <span style="color: blue;">Then</span>
        <span style="color: blue;">Dim</span> OutputMS <span style="color: blue;">As</span> <span style="color: blue;">New</span> <span style="color: rgb(43, 145, 175);">MemoryStream</span>()
        convertPdf.GetNextImage(OutputMS, <span style="color: rgb(43, 145, 175);">ImageFormat</span>.Bmp)


        <span style="color: green;">'b = GetOptimizedImage(OutputMS, TargetFormat)</span>
        <span style="color: blue;">Dim</span> image <span style="color: blue;">As</span> <span style="color: blue;">New</span> <span style="color: rgb(43, 145, 175);">Bitmap</span>(OutputMS)
        image.Save(outputFile) <span style="color: green;">'assume this is a BMP</span>

        OutputMS.Dispose()

    <span style="color: blue;">End</span> <span style="color: blue;">If</span>

    ms.Dispose()
    convertPdf.Close()

<span style="color: blue;">End</span> <span style="color: blue;">Sub</span>


Function GetResolution(ByVal width As Double) As Integer
width = width / 72 'Convert in inch
If (width < 8.5) Then
Return 816 / width ’ (8.5 x 96dpi)/width
Else
Return 96
End If
End Function

Any ideas why this happens?

Hi Justin,


Thanks
for contacting support.<o:p></o:p>

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-35009. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

Thanks. Can you tell me what is wrong with this PDF such as what properties we can look at to determine which ones will cause this issue? The reason I ask is that we can then go back to our customer and tell them any PDF with this certain property will not work for the time being until a fix is given.

Thanks. Can you tell me what is wrong with this PDF such as what properties we can look at to determine which ones will cause this issue? The reason I ask is that we can then go back to our customer and tell them any PDF with this certain property will not work for the time being until a fix is given.Thanks. Can you tell me what is wrong with this PDF such as what properties we can look at to determine which ones will cause this issue? The reason I ask is that we can then go back to our customer and tell them any PDF with this certain property will not work for the time being until a fix is given.

Hi Justin,


As we just have been able to notice this issue, so the development team requires little time to investigate and figure out the actual reasons of this issue. Please be patient and spare us little time. We are sorry for this inconvenience.


PS, Every issue is analyzed and resolved as per schedule and currently development team is working hard on resolving other priority issues and as soon as they will get free from current tasks, they will start working over this problem.

It’s been a couple of months. Any update on this issue?

Hi Justin,


Thanks for your patience.

The development team has been busy resolving
other priority issues and I am afraid the issue reported earlier is not yet
resolved. Nevertheless, I have requested the team to share the ETA regarding
its resolution. As soon as we have some definite updates regarding its
resolution, we would be more than happy to update you with the status of
correction. Please be patient and spare us little more time.<o:p></o:p>

We are really sorry for
this inconvenience.

We are still waiting for a response on this. Do you have any updates yet? This is affecting a large majority of our customers.

Hi Justin,


Thanks for your patience.

The development team got busy with some other priority tasks/issues and therefore the earlier reported issue is not yet resolved. Nevertheless, I have again intimated the
development team to investigate this problem and share any possible ETA. As soon as we
have some further updates, we would be more than
happy to update you with the status of correction.

Is there any way we can escalated this or pay time to get this escalated? If we cannot get this resolved soon we are going to have to look for another solution as this is giving customers a very sour perception of the product.

Hi Justin,


<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#333333”>Please note that you have reported issue under normal/free support
forum and as a normal rule of practice, issues are resolved in first come
and first serve basis; but the problems logged/reported under Enterprise or
Priority support model, have high precedence in terms of resolution, as compare
to issues under normal/free support model.
<o:p></o:p>

In case you need to have your issue prioritized, you may consider opting for Enterprise or Priority support options. Nonetheless, note that ES/PS support does not guarantee any immediate resolution of issues (because it might be dependent on other issues or feature which needs to be implemented) but under this model, the development team starts investigating the problem on high priority. For further details, please visit Support Options.

We are sorry for this delay and inconvenience.

Hi Justin,


Thanks for your patience.

I have further discussed the scenario with development team and they have planned the resolution of issue for Aspose.Pdf for .NET 9.1.0, which is planned to release in April-2014 (but still it’s not a promise). We will try our level best to get the issue resolve by said time.

The issues you have found earlier (filed as PDFNEWNET-35009) have been fixed in Aspose.Pdf for .NET 9.4.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.