Print Page | Close Window

Problem with create pdf document

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2142
Printed Date: 24 Jun 25 at 11:20AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problem with create pdf document
Posted By: AlexCasual
Subject: Problem with create pdf document
Date Posted: 10 Feb 12 at 3:40PM
 Hello guys!

I have code :

bool CreateFormatText( std::wstrint& file,  std::wstrint& text,  int x,  int y)
{

#ifdef _WIN64
QuickPDFDLL0813 QP(L"QuickPDF64DLL0813.dll");
#else
QuickPDFDLL0813 QP(L"QuickPDFDLL0813.dll");
#endif

// Library key
std::wstring strLicenseKey = L"my_key";

int iResult = QP.UnlockKey(strLicenseKey);
if(iResult != 1)
{
return false;
}

QP.NewDocument();
QP.SetOrigin(1);

QP.AddImageFromFile(file.c_str(), 0);

int lWidth  = QP.ImageWidth();
int lHeight = QP.ImageHeight();
QP.SetPageDimensions(lWidth,lHeight);

QP.DrawImage(0, 0, lWidth, lHeight);

QP.DrawText(x,y,text);

std::wstring pdf = file;
pdf.append(L"pdf");

QP.SaveToFile(pdf.c_str());

return true;
}

And when i try call CreateFormatText() in cycle more than once,saved pdf-files superimposed one on one...And i have incorrectpdf-files! Please help shoot this problem!



Replies:
Posted By: AndrewC
Date Posted: 11 Feb 12 at 2:24AM
This link has all the functions and logic to create a multipage PDF file at the correct size.  The important functions are

  QP.NewPage();
  QP.ImageHorizontalResolution()
  QP.RemoveDocument()

http://www.quickpdf.org/forum/creating-a-multi-page-pdf-from-a-multipage-tiff_topic2125.html - http://www.quickpdf.org/forum/creating-a-multi-page-pdf-from-a-multipage-tiff_topic2125.html

Andrew.


Posted By: AlexCasual
Date Posted: 11 Feb 12 at 5:44PM
Thank you Andrew!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk