Call to PXC_PlaceImage failing

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Call to PXC_PlaceImage failing

Post by steves » Tue Apr 12, 2005 4:41 pm

Hi,

Have resolved previous issue with not finding pxclib30.dll in ASP.NET, many thanks.

We've built a dll under VB.NET that calls your dlls to convert a multipage DCX to PDF. It works fine when called from either a WinForms app or a locally hosted ASP.NET application. When we come to run it on our hosted server we are getting an 'Object reference not set to an instance of an object' error with the app failing on a call to PXC_PlaceImage.

We've cut back the code to prove with a GIF file and it is still not working - please see the relevant sample code below.

Dim page As Integer
Dim cpage As Integer
Dim p As Integer
Dim res As Integer = PDFXC_Funcs.PXC_AddPage(pdf, Common.PW, Common.PH, page)
If (Common.IS_DS_FAILED(res)) Then
Return res
End If
cpage = page
res = PDFXC_Funcs.PXC_AddImageA(pdf, fname, p)
If (Common.IS_DS_FAILED(res)) Then
Return res
End If

PDFXC_Funcs.PXC_PlaceImage(cpage, p, Common.I2L(1), Common.PH - Common.I2L(1), Common.I2L(3), Common.I2L(2))

Any ideas?

Many thanks.


Steve Spooner

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Apr 13, 2005 8:22 am

Hi Steve,

there is nothing obviously wrong in the code posted - can you post more detail on your declarations for :

PDFXC_Funcs.PXC_AddPage
PDFXC_Funcs.PXC_AddImageA
PDFXC_Funcs.PXC_PlaceImage

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Declarations

Post by steves » Wed Apr 13, 2005 1:22 pm

Hi,

Declarations as follows:-

<DllImport("pxclib30")> _
Public Shared Function PXC_AddPage(ByVal pdf As Integer, ByVal width As Double, ByVal height As Double, ByRef page As Integer) As Integer
End Function

<DllImport("pxclib30")> _
Public Shared Function PXC_AddImageA(ByVal pdf As Integer, <MarshalAs(UnmanagedType.LPStr)> ByVal filename As String, _
ByRef image As Integer) As Integer
End Function

<DllImport("pxclib30")> _
Public Shared Function PXC_PlaceImage(ByVal content As Integer, ByVal image As Integer, ByVal x As Double, ByVal y As Double, _
ByVal width As Double, ByVal height As Double) As Integer
End Function

Runtime log is included as attachment - PXC_PlaceImage does not seem to have returned.

Regards,


Steve Spooner
Attachments
debug.ZIP
(395 Bytes) Downloaded 105 times

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Apr 14, 2005 9:01 am

Hi Steve,

it is conceiveable that there is a server setting that is not correctly set up - or possibly an older dll of ours in residence on the server?

However - to try to narrow this down - please put this code :

res = PDFXC_Funcs.PXC_PlaceImage(cpage, p, Common.I2L(1), Common.PH - Common.I2L(1), Common.I2L(3), Common.I2L(2))

In place of :

PDFXC_Funcs.PXC_PlaceImage(cpage, p, Common.I2L(1), Common.PH - Common.I2L(1), Common.I2L(3), Common.I2L(2))
(only "res=" added)

Hopefully this should return a get "res" (return) value, and we can then check our error codes listing and try to ascertain the problem from there.

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Return value

Post by steves » Thu Apr 14, 2005 1:20 pm

Hi,

I'm getting mixed results here - sometimes the PXC_PlaceImage will not return, othertimes it will return 0 and a PDF will be created. However this PDF is reported as corrupt when I try to load it in Acrobat. I'm enclosing both the source gif and the generated PDF. Perhaps this could be some sort of memory related issue?

Are there any resources in terms of file areas or memory that need to be allocated in our application - I've noticed you have PXC_Alloc and PXC_Free functions defined in your help file.

Many thanks,


Steve Spooner
Attachments
results.ZIP
(37.41 KiB) Downloaded 103 times

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Apr 14, 2005 2:54 pm

Thanks Steve,

looking into
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Apr 14, 2005 3:13 pm

Very strange PDF file steve - full of zero byte values.

Can I ask you to please put together a small sample app (source and compiled) that works on your local systems - but fails when on your ASP server and then to zip this up and send to us so we can try and replicate here - otherwise I think we are just going to go around in circles.

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Sample app

Post by steves » Fri Apr 15, 2005 2:36 pm

Hello,

I'm enclosing a sample app that works fine on my local web server, but fails in our hosted environment.

The code is attempting to convert a three page DCX to PDF, rather than the gif file mentioned earlier (we were only using gifs prior to this to try to simplify things - DCX to PDF is what we ultimately want to achieve).

Hope you can help.

Many thanks.


Steve Spooner
Attachments
webapp.ZIP
(1.39 MiB) Downloaded 112 times

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Mon Apr 18, 2005 2:59 pm

Hi Steve,

Please see attached from our project developer who has tested this in-house and made some changes - he comments :
very strange behaviour in this user's code.

His function WriteLog does some odd things then loops round to the goto function once again and afterwards then proceeds ok (odd)

However - the directory does not naturally have permission for creating file's but the file will be created after a 2nd call to this function as mentioned.

Maybe this is a bug in IIS?

However when I comment WriteLog I cannot proceed and write the file, this is normal because the directory has no permission for this
after adding Write permission and then again going to Write the Document this gives a good result, the file is created ok.

I am not entirely sure why all the above happens as it does but I reccomend the developer debug's this code (with my changes, I have commented the calls to WriteLog and add 'res=' to display the return code) on the server - also importantly the server must have Write permission to the necessary directories.
Attachments
WebApplication8.zip
ASP app
(190.68 KiB) Downloaded 99 times
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Another sample app

Post by steves » Tue Apr 19, 2005 4:19 pm

Hi,

Many thanks for taking a look at the project I sent previously.

We do not have write permissions on our hosted server, but I'm still able to successfully create a PDF there. I've substituted the PXC_PlaceImage function with a function that writes example text from one of your demo applications, and that works fine - I enclose the project, plus example output (Comments.PDF).

I'm pretty sure the issue is with PXC_PlaceImage - does this function have a specific set of requirements in order to work correctly? Is there some example code I could run to exercise PXC_PlaceImage to try to find out what the issue is?

Many thanks.


Steve Spooner

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Apr 19, 2005 4:45 pm

Hi Steve,

I doubt very much it is PXC_PlaceImage - I suspect it really is a write permissions issue - but we will look into without prejudging.

One small note Steve (and all) if posting files please ensure they are devoid of your licensing info - we would not want you license info getting into unauthorised hands for free use - would we ? ;)

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Apr 20, 2005 8:10 am

Hi Steve,

Please see the attached VB.NET example - please try this on your server and advise if the problem you have encountered persists - this should give us a better indication of if the problem is ASP/Server or Function based.

As you know our knowledge of ASP is limited and with the added complication of the possibility being there is some server configuration issue - we hope this will be easier to help us nail down the problem.

Thanks.
Attachments
Tiff2Pdf_vbnet.zip
VB.NET application
(24.52 KiB) Downloaded 113 times
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Post by steves » Wed Apr 20, 2005 9:59 am

Hi,

Many thanks for posting your test project, unfortunately I'm only running Visual Studio 2002 - do you have a version for VS2002?

Apologies for licensing issue, will be more careful next time.

Once again many thanks for your support in trying to get to the bottom of this issue.


Kind regards,


Steve Spooner

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Apr 20, 2005 1:52 pm

Hi Steve,

we dont have 2002 installed at this time - I am reliably informed that if you take our source files as supplied and make a new project using these - you can use within 2002 ?

If this causes a problem please let me know and we will install 2002 - but it may be a few days befoere we can do so.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Post by steves » Wed Apr 20, 2005 4:55 pm

Hi,

Thanks for all your help - have converted your test program to ASP.NET app (have included project), ran fine on local server but call to PXC_PlaceImage failed to return on hosted server. Commenting out PXC_PlaceImage created a blank 3 page PDF on hosted server, as we would expect.

I understand your concern about write permissions but as we seem to be able to create a blank PDF on our hosted server, and a PDF with text in it (in a previous project I've posted) I'm wondering if something else is going on. Realistically not many ASP.NET hosting arrangements are going to allow write access to their servers.

From what I can see the problem seems to be PXC_PlaceImage not running properly on the hosted server - would it be possible to arrange a one to one telephone call to chat about what the PlaceImage function does in more detail to see if we can get to the bottom of solving this?

Many thanks,


Steve Spooner
Attachments
Tiff2Pdf_vbnet.ZIP
(1.62 MiB) Downloaded 102 times

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Apr 21, 2005 7:19 am

Steve,

please see your mail inbox.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

New build

Post by steves » Tue Apr 26, 2005 4:11 pm

Hi,

Have tried new build posted on website, but unfortunately doesn't perform any differently to previous version - still locking up in PXC_PlaceImage.

Could you advise where to go from here, and if you feel we are getting close to getting a resolution.


Many thanks,


Steve Spooner

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Apr 26, 2005 4:23 pm

Hi Steve,

will need to discusss this with Fedir here - but in the meantime if this is possible this may provide some insight - please see below :

The other option is to do as outlined in this FAQ message and post the files created - hopefully this may provide more insight.

http://www.tracker-software.com/forum/v ... .php?t=800

Please download debugview from the link below and start before starting your application - then run your app.

Once the error occurs - copy/paste or save the debug window info to a file and please post here.

DebugView (free)
http://www.sysinternals.com/ntw2k/utilities.shtml

Hopefully one of the above will provide some useful info to isolate the issue.

Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Post by steves » Wed Apr 27, 2005 8:39 am

Hi,

Many thanks for your note - unfortunately the debug apps you mentioned would need to be installed on our hosted server, which by the terms of our hosting arrangement we are unable to do.

Will wait to hear if Fedir has any ideas.


Regards,


Steve Spooner

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Apr 27, 2005 12:48 pm

Hi Steve,

can we get access to your server direct to allow us to test and modify if necessary to help you resolve ?

If so please email Fedir or myself with the info and any restrictions etc
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

steves
User
Posts: 11
Joined: Mon Apr 11, 2005 10:25 am

Post by steves » Wed Apr 27, 2005 2:50 pm

Hi,

We'll set you up with a test domain - will forward details to you tomorrow.


Many thank,



Steve Spooner

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Apr 27, 2005 3:03 pm

OK - thanks Steve.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply