Jump to content

How to turn to page x# with UniPDFFrame


55143681

Recommended Posts


If you want to use a button to go to a specific page

 

procedure TMainForm.bSetPageClick(Sender: TObject);
begin
    UniSession.AddJS (pdfFrame.JSName + '.iframe.contentWindow.PDFViewerApplication.page=' +  IntToStr(UniSpinPage.Value));
end;
 

  • Upvote 1
Link to comment
Share on other sites

On 1/6/2021 at 6:33 PM, azago said:


If you want to use a button to go to a specific page

 

procedure TMainForm.bSetPageClick(Sender: TObject);
begin
    UniSession.AddJS (pdfFrame.JSName + '.iframe.contentWindow.PDFViewerApplication.page=' +  IntToStr(UniSpinPage.Value));
end;
 

thanks ,that works well.

And how to move the the first page\the last page\the prior page\the next page?

Link to comment
Share on other sites

Just now, 55143681 said:

thanks ,that works well.

And how to move the the first page\the last page\the prior page\the next page?

And for c++builder:

UniSession->AddJS(UniPDFFrame1->JSName +".iframe.contentWindow.PDFViewerApplication.page="+IntToStr(UniSpinEdit1->Value));

Link to comment
Share on other sites

Sorry but I only use only and always Delphi (for thirty years ...) and I don't know C ++

anyway in Delphi

First Page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.'  + 'getElementById ("firstPage").click()');
 

Last page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.' + 'getElementById ("lastPage").click()');
 

Next page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.' + 'getElementById ("next").click()');
 

Previous Page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.' + 'getElementById ("previous").click()');


i used unigui for a document solution

image.thumb.png.f1f2600b9db1f848cb376e55f1c7b4b8.png

 

Angelo
 

  • Upvote 1
Link to comment
Share on other sites

3 hours ago, azago said:

Sorry but I only use only and always Delphi (for thirty years ...) and I don't know C ++

anyway in Delphi

First Page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.'  + 'getElementById ("firstPage").click()');
 

Last page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.' + 'getElementById ("lastPage").click()');
 

Next page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.' + 'getElementById ("next").click()');
 

Previous Page

UniSession.AddJS (uHTMLPDF.JSName + '.iframe.contentWindow.document.' + 'getElementById ("previous").click()');


i used unigui for a document solution

image.thumb.png.f1f2600b9db1f848cb376e55f1c7b4b8.png

 

Angelo
 

how use code to print pdf ?

Link to comment
Share on other sites

2 hours ago, azago said:

or

 UniSession.AddJS (pdfFrame.JSName + '.iframe.contentWindow.document.' + 'getElementById ("print").click()');
 

 

Thanks a log,c++ builder code as follow:


void __fastcall TMainForm::UniBitBtn1Click(TObject *Sender)
{
UniSession->AddJS (UniPDFFrame1->JSName + ".iframe.contentWindow.document."  + "getElementById (\"firstPage\").click()");

}
//---------------------------------------------------------------------------

void __fastcall TMainForm::UniBitBtn4Click(TObject *Sender)
{
UniSession->AddJS (UniPDFFrame1->JSName + ".iframe.contentWindow.document." + "getElementById (\"lastPage\").click()");
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::UniBitBtn3Click(TObject *Sender)
{
UniSession->AddJS (UniPDFFrame1->JSName + ".iframe.contentWindow.document." + "getElementById (\"next\").click()");
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::UniBitBtn2Click(TObject *Sender)
{
UniSession->AddJS (UniPDFFrame1->JSName + ".iframe.contentWindow.document." + "getElementById (\"previous\").click()");
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::UniBitBtn6Click(TObject *Sender)
{
UniSession->AddJS (UniPDFFrame1->JSName + ".iframe.contentWindow.document." + "getElementById (\"print\").click()");
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::UniBitBtn5Click(TObject *Sender)
{
UniSession->AddJS (UniPDFFrame1->JSName + ".iframe.contentWindow.PDFViewerApplication.page=" +  IntToStr(UniSpinEdit1->Value));

}
//---------------------------------------------------------------------------
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...