|
Rank: Newbie Groups: Member
Joined: 12/3/2013 Posts: 9
|
I have an web application that adds elements (texts and/or images) to pdf files uploaded by web users. In most cases it works fine however in some cases the added text is displayed upside down and I don't know how to fix it. Isolate the problem by using the following sample code (VB Console Application) that produces the same wrong result for some files. Could you please help me?
Code: Visual Basic.NET
Imports EO.Pdf
Imports EO.Pdf.Acm
Module Module1
Sub Main()
EO.Pdf.Runtime.AddLicense("MyLicenceKey..."")
Dim Doc As New PdfDocument("C:\tmp\SourceDocument.pdf")
Dim Page As PdfPage = Doc.Pages(0)
Dim pageLayout As New AcmPageLayout(New AcmPadding(0))
Dim render As New AcmRender(Page, 0, pageLayout)
Dim objAcmBlock As New AcmBlock()
objAcmBlock.Style.Top = 1
objAcmBlock.Style.Left = 1
Dim text As New AcmText("Hello World")
objAcmBlock.Children.Add(text)
render.Render(objAcmBlock)
Doc.Save("C:\tmp\DestinationDocument.pdf")
End Sub
End Module
You can see the result here (): Wrong Document
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, Most likely this is caused by rotation/transform settings on your page. The latest version would automatically compensate for such settings, but our early versions does not. So if you are not already using the latest version, please try to the latest version first and see if it resolves the issue for you. If the latest version still does not resolve the issue for you, please send your PDF file to us and we will look into it here and see what we can find. See here for more information on how to send test files to us: https://www.essentialobjects.com/forum/test_project.aspxThanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/3/2013 Posts: 9
|
Indeed, I am using an old version of EO and the new version worked without problems. However, I would like to continue using the same old version that I already have in production and for which I paid a license. In this regard I would like to consult: Is it possible to correct (or reset) the page rotation/transform settings by code so that the problem is solved? Yesterday I tried the next code (based on an example from this forum):
Code: Visual Basic.NET
Dim Doc As New PdfDocument("C:\tmp\SourceDocument.pdf")
Dim matrix As New Drawing.PdfMatrix()
Doc.Pages(0).Transform(matrix)
...
It solve the problem ('Hello World' text now appears in correct position/orientation), but a error mesaje about file consistency appears in Acrobat Reader when then file is opened... Possibly I am missing something to make everything coherent... Can you help me about this?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Unfortunately we won't be able to make the old version work without applying the necessary code changes. There are multiple code changes on our side that addresses this issue. So it is not a simple transform. Beside the transform could also affect your existing contents.
Additionally, we officially only provide tech support for one year after the purchase. I see that your order was many years ago, so in fact you are no longer eligible for tech support either. As such moving forward you should definitely consider updating to the newer version.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/3/2013 Posts: 9
|
OK. Thank you very much for your comments.
|
|