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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - Problem with SETPDFAMode
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem with SETPDFAMode

 Post Reply Post Reply
Author
Message
josepmz View Drop Down
Beginner
Beginner


Joined: 03 Oct 11
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote josepmz Quote  Post ReplyReply Direct Link To This Post Topic: Problem with SETPDFAMode
    Posted: 03 Oct 11 at 11:16AM
Hello,

I'm evaluating QuickPDFLibrary, I think that is a very good library. Great Joob.
I've problems with QuickPDFDLL0811.dll in C++ version (MS 2008);
When I try to use SETPDFAMode and save the document, the document is not PDF/A compliance.

Is any limitation with Evaluation Keys?

Any help wold be apreciated Wink

My code:

#include "stdafx.h"
#include "QuickPDFDLL0811.h"


std::wstring Utf8ToUtf16(const std::string &s)
{
    std::wstring ret;
    int len = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.length(), NULL, 0);
    if (len > 0)
    {
      ret.resize(len);
      MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.length(), const_cast<wchar_t*>(ret.c_str()), len);
    }
    return ret;
}

std::string Utf16ToUtf8(const std::wstring &s)
{
    std::string ret;
    int len = WideCharToMultiByte(CP_UTF8, 0, s.c_str(), s.length(), NULL, 0, NULL, NULL);
    if (len > 0)
    {
      ret.resize(len);
      WideCharToMultiByte(CP_UTF8, 0, s.c_str(), s.length(), const_cast<char*>(ret.c_str()), len, NULL, NULL);
    }
    return ret;
}

int _tmain(int argc, _TCHAR* argv[])
{
   
    QuickPDFDLL0811 QP(Utf8ToUtf16("QuickPDFDLL0811.dll"));
    int iResult = QP.UnlockKey(Utf8ToUtf16("MyRegKey"));
    QP.SetPDFAMode(2);
    QP.SetOrigin(1);
   
    int fontID1 = QP.AddTrueTypeFont(Utf8ToUtf16("Times New Roman"), 1);   
    QP.SelectFont(fontID1);

    QP.DrawText(25, 25, Utf8ToUtf16("This text was drawn using the DrawText function."));
    if(QP.SaveToFile(Utf8ToUtf16("PDF-A_Document.pdf"))==1)
    {
        _tprintf(_T("grabado\n"));
    }
    else
    {
        _tprintf(_T("no grabado\n"));
    }

    return 0;
}




Edited by Ingo - 03 Oct 11 at 10:25PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 03 Oct 11 at 10:34PM
Hi Josep!

Who tells you that the resulting document isn't real PDF/A?
With AddTrueTypeFont you won't EMBED the font and
embedding the used fonts is necessary to get a PDF/A-document.

Cheers and welcome here,
Ingo

Back to Top
josepmz View Drop Down
Beginner
Beginner


Joined: 03 Oct 11
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote josepmz Quote  Post ReplyReply Direct Link To This Post Posted: 04 Oct 11 at 8:26AM
Hi Ingo,

My document is not PDF/A beause I don't see legend on Acrobat Reader that says:
"The file you have opened complies with the PDF/A standard and has been opened read-only to prevent modificacion.

My code is based on samples at QuickPDF Library 8.11 console (2.11), on Document Management/Create PDF-A Document. When I run this sample, the PDF/A is correct, but when I run in my Visual Studio 2008 c++ project, it run but is not PDF/A compliance.

When I created this code on QPL console it works fine, and the PDF is PDF/A:

QP.SetPDFAMode(2);
QP.SetOrigin(1);
var fontID1 = QP.AddTrueTypeFont("Times New Roman", 1);
QP.SelectFont(fontID1);
QP.DrawText(25, 25, "This text was drawn using the DrawText function.");
QP.SaveToFile(GetOutputFolder() + "PDF-A_Document.pdf");
DisplayPDFReader(GetOutputFolder() + "PDF-A_Document.pdf");

thanks Ingo, any help would be apreciated.
Back to Top
josepmz View Drop Down
Beginner
Beginner


Joined: 03 Oct 11
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote josepmz Quote  Post ReplyReply Direct Link To This Post Posted: 07 Oct 11 at 9:33AM
Hi,

anybody can help me?
I can't create PDF/A documents in Visual Studio 2008 c++ with QuickPdfLibrary 8.11 o 8.12, it seems its ok, but the PDF/A is not created.

My sample code is on firts post.

Thanks!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store