Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Generating images : Error Msg |
Post Reply |
Author | ||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
Posted: 17 Oct 06 at 10:19AM |
|||
Hi !
I'm still watching for generating images from pdf files... Now, the code seems to be OK, but I have problems with few files... Here is the Error : iSED.QuickPDF erreur '8000ffff' Cannot create file "c:\windows\system32\inetsrv\0.jpg". Accès refusé /admin/cat-upload-pdf.asp, ligne 94 And my ASP Code : 'On place le fichier dans le répertoire d'upload temporaire... Set Upload = Server.CreateObject("Persits.Upload.1") Upload.Save Server.Mappath("/upload/") IDCatalogue = Upload.Form.Item("id").Value 'On sauvegarde le chemin du fichier PDF téléchargé FichierCatalogue = Upload.Files("FichierPDF").Path 'On crée l'objet QuickPDF Dim QP Set QP = Server.CreateObject("iSED.QuickPDF") Call QP.UnlockKey(PDFLicence) 'On ouvre le fichier téléchargé QP.LoadFromFile(FichierCatalogue) 'On tente de le decrypter... If QP.DecryptFile(FichierCatalogue,FichierCatalogue,false)=0 Then If QP.Unencrypt = 0 Then Response.Write(":(") Else Response.Write(":)") End If Else Response.Write(":)") End If 'On crée les images à partir du fichier QP.SelectPage 1 If (QP.RenderDocumentToFile(150, 1, QP.PageCount, 1, Server.MapPath(CheminCatalogue) & "/img/large/page-%p.jpg")=0) Then Response.Write("Erreur lors de la transformation du fichier !!!") Else Response.Write("OK !") End If In bold, the line which causes the error... What is this error about ? |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
Does anybody had the same problem ???
|
||||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
|||
Hi!
You have enough rights to access system32? Try with another directory... The same error? Perhaps the 0.jpg already exists? Best regards, Ingo Edited by Ingo |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
Hi, actually, i'm not writing anything in this directory, i guess the method is doing it... I write on d:/... not on c:/... And few files are passing trought the script succesfully ! :) |
||||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
|||
Hi!
No... I think it's C ;-) Cannot create file "c:\windows\system32\inetsrv\0.jpg". Accès refusé Best regards, Ingo |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
No, this message occurs only when the file is causing trouble, the files are wroten in D:/www/upload (path génerated with the Server.Mappath("/upload/") method !!! I have never specified the c:/windows/system32 folder, i'm not that crazy ! :) Don't you have an idea for resolving that ? If you want to test : File that is working : http://www.thinktwice.info/quickpdf/ok.pdf File that is not working : http://www.thinktwice.info/quickpdf/nok.pdf Regards, Antoine |
||||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
|||
Hi Antoine!
The ok.pdf includes imagesfiles but they are NOT inserted as "embedded imagefiles". The nok.pdf includes two imagefiles inserted as "embedded imagefiles". Perhaps there's the problem? Again to the error-message... "Anybody" wants to write a jpg-file in c...system32... This is what the error-message is telling you. Who's doing this ;-) Best regards, Ingo |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
I Guess the function 'RenderDocumentToFile' is doing it, cause i'm not... I'm webdevelopper since 2005, and i can bet 100 box with you my code is not writing on C:... My Web folder is on D:, and the successful files are really on D: By the way, how do you get his 'embedded imagefiles' property ? I'm gonna check with few files that don't work... By the way, I added few files : - http://www.thinktwice.info/quickpdf/ok-2.pdf - http://www.thinktwice.info/quickpdf/ok-3.pdf - http://www.thinktwice.info/quickpdf/nok-2.pdf - http://www.thinktwice.info/quickpdf/nok-3.pdf - http://www.thinktwice.info/quickpdf/nok-4.pdf Regards, Antoine |
||||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
|||
Hi! My PDF-Analyzer did this for me ;-) Best regards, Ingo |
||||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
|||
Hi Antoine!
nok-4.pdf is a monster ... Needs a bit time to analyze ;-) Sorry but embedded or not doesn't seem to be the problem. All files (ok and nok) have partly same properties... We should look into the function-source: What happens if it returns an error? Best regards, Ingo |
||||
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
|||
Antoine,
just an idea: can you check QuickPDFs temppath? Use: - GetTempPath gives you the current one - SetTempPath(Path) can used to set it to a userdefined one - TestTempPath checks the current temp path to have read/write access maybe this explains the writing on 'c:\windows\system32\inetsrv'; HTH, Uli |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
The TempPath is C:\WINDOWS\TEMP\, not c:\windows\system32\inserv, I have already changed that to another value, but the problem is the same... Actually, i don't think it's a permission problem becaus few files are passing trough the script successfully... By the way the 0.jpg file can also be 1568.jpg or anything else... Here is the full code of the page... <!-- #include virtual="/includes/param.asp" --> <% Server.ScriptTimeout = 180 PDFLicence = "000000000000000000000000000000" 'Putting file in /upload/ Set Upload = Server.CreateObject("Persits.Upload.1") Upload.Save Server.Mappath("/upload/") IDCatalogue = Upload.Form.Item("id").Value 'Grabbing path to write to Set RS = Server.CreateObject("Adodb.recordset") SQL = "SELECT CLIENT_Directory, CATALOGUE_Directory FROM TBL_CLIENT, TBL_CATALOGUE WHERE FK_CLIENT_Id = CLIENT_Id AND CATALOGUE_Id=" & IDCatalogue & " AND CLIENT_Id = " & Session("ADMIN_IdClient") RS.Open SQL, MyConn, 3, 3 'Response.Write SQL CheminCatalogue = RS("CLIENT_Directory") & RS("CATALOGUE_Directory") 'Saving the path to the file FichierCatalogue = Upload.Files("FichierPDF").Path ' QuickPDF Stuff Dim QP Set QP = Server.CreateObject("iSED.QuickPDF") Call QP.UnlockKey(PDFLicence) 'Opening the file... QP.LoadFromFile(FichierCatalogue) 'Security Info 'For i=0 To 10 'Response.Write (i & ": " & QP.SecurityInfo(i) & "<br />") 'Next 'Decrypt... If QP.DecryptFile(FichierCatalogue,FichierCatalogue,Upload.Form.Item("pwd").Value)=0 Then If QP.Unencrypt = 0 Then Response.Write(":(") Else Response.Write("Unencrypt :)") End If Else Response.Write("DecryptFile :)") End If 'Checking if path are already created... Set FSO = CreateObject("Scripting.FileSystemObject") If Not FSO.FolderExists(Server.Mappath(CheminCatalogue)) Then FSO.CreateFolder(Server.Mappath(CheminCatalogue)) End If If Not FSO.FolderExists(Server.Mappath(CheminCatalogue) & "/img") Then FSO.CreateFolder(Server.Mappath(CheminCatalogue) & "/img") End If If Not FSO.FolderExists(Server.Mappath(CheminCatalogue) & "/img/large") Then FSO.CreateFolder(Server.Mappath(CheminCatalogue) & "/img/large") End If If Not FSO.FolderExists(Server.Mappath(CheminCatalogue) & "/img/medium") Then FSO.CreateFolder(Server.Mappath(CheminCatalogue) & "/img/medium") End If If Not FSO.FolderExists(Server.Mappath(CheminCatalogue) & "/img/small") Then FSO.CreateFolder(Server.Mappath(CheminCatalogue) & "/img/small") End If QP.SelectPage 1 'On crée les images à partir du fichier If (QP.RenderDocumentToFile(72, 1, QP.PageCount, 1, Server.MapPath(CheminCatalogue) & "/img/large/page-%p.jpg")=0) Then Response.Write("Erreur lors de la transformation du fichier !!!") Else Response.Write("OK !") End If 'For DB insertion Set RS = Server.CreateObject("Adodb.recordset") SQL = "SELECT PAGE_Ordre FROM TBL_PAGE WHERE FK_CATALOGUE_Id=" & IDCatalogue & " ORDER BY PAGE_Ordre DESC" Response.Write SQL & "<br /><br />" RS.Open SQL, MyConn, 3, 3 If (RS.EOF) Then MyOrdre = 0 Else MyOrdre = RS("PAGE_Ordre") + 1 End If 'On insère les pages dans le catalogue For i=1 To QP.PageCount 'On insère l'image dans la base de donnée SQL = "INSERT INTO TBL_PAGE (PAGE_FichierImage, PAGE_Libelle, PAGE_Ordre, FK_CATALOGUE_Id) VALUES ('page-" & i & ".jpg', 'Page " & (MyOrdre + 1) & "', " & MyOrdre & ", " & IDCatalogue & ")" MyConn.Execute SQL Response.Write SQL MyOrdre = MyOrdre + 1 'On copie l'image vers les répertoires medium et small Set canvas = CreateObject("ImageGlue6.Canvas") theFile = Server.Mappath(CheminCatalogue) & "\img\large\page-" & i & ".jpg" canvas.DrawFile theFile, "height<=550" canvas.SaveAs Server.Mappath(CheminCatalogue) & "\img\medium\page-" & i & ".jpg", "" canvas.Clear Set canvas = CreateObject("ImageGlue6.Canvas") theFile = Server.Mappath(CheminCatalogue) & "\img\large\page-" & i & ".jpg" canvas.DrawFile theFile, "width<=100" canvas.SaveAs Server.Mappath(CheminCatalogue) & "\img\small\page-" & i & ".jpg", "" canvas.Clear 'Et on resize... Next 'Deleting the temp file... FSO.DeleteFile(Upload.Files("FichierPDF").Path) 'On libère les variables Set FichierCatalogue = Nothing Set QP = Nothing Set Upload = Nothing Set FSO = Nothing Set canevas = Nothing 'Redirecting... Response.Redirect("pages-manage.asp?id=" & IDCatalogue) Set IDCatalogue = Nothing %> |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
The error is on the line
If (QP.RenderDocumentToFile(72, 1, QP.PageCount, 1, Server.MapPath(CheminCatalogue) & "/img/large/page-%p.jpg")=0) Then Regards, Antoine |
||||
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
|||
Where does Server.MapPath(CheminCatalogue) resolve to? Could the "%" in the filename be causing a problem?
Edited by bogey |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
This path is pointing to dynamic folders in my D:/www/...
I tried with and without the "%", but it is a parameter allowed by the function :
|
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
Still no idea ? |
||||
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
|||
Have you tried to render to a fixed file to see if this works? (say render to "/img/large/testpage.jpg")
I have tried some of your PDFs from a delphi app and the render fine, so it seems to be a different issue. HTH, Uli |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
Yes, same issue...
|
||||
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
|||
If you are getting "access refused" errors, then you have a file permissions problem. Create a TEMP folder to store the PDFS and assign WRITE privledges to the INETUSR account.
|
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
As it works for few files, i don't think that it is a permission problem. What's more is that I can specify any folder, the error always occurs on c:/windows/... |
||||
Pirmin
Team Player Joined: 28 Nov 05 Status: Offline Points: 28 |
Post Options
Thanks(0)
|
|||
Hi beowax I have never used QuickPDF with ASP. But reading the iSEDQuickPDF Knowledge Base let me assume that you, or the ASP Programming Environment, has copied the ActiveX library (iSED.dll) to C:\WINDOWS\system32\inetsrv. Regards, Edited by Pirmin |
||||
marian_pascalau
Debenu Quick PDF Library Expert Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
Post Options
Thanks(0)
|
|||
Hi there, Pirmin is right. I can confirm that this was an isue with older QPDF versions. I don't know who solved that problem but it should never occur in the new version again. Regards, Marian |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
OK, I'll check that as soon as I can, thank you.
I will inform you of the version number. ;) |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
My version is 5.11, but i can't find wexer versions on your website... Where can I find them ?
Regards, Antoine |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
I saw the topic where the downloads are. ;) I havn't got any .pas file. Is it possible me to send my key ? |
||||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
|||
Hi!
If you have a source-license you can send the smallest source-file to Michel or to me and then we'll send you the new password for the source-section. Best regards, Ingo |
||||
beowax
Beginner Joined: 17 Oct 06 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
|||
Hi, The current version has solved the problem.
Thanks for your help, Regards, Antoine |
||||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store