mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Fix bug 75044
This commit is contained in:
@ -1869,10 +1869,14 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF
|
||||
double dPageH = pD->GetType() == PdfWriter::object_type_NUMBER ? ((PdfWriter::CNumberObject*)pD)->Get() : ((PdfWriter::CRealObject*)pD)->Get();
|
||||
pD = pPageBox->Get(0);
|
||||
double dPageX = pD->GetType() == PdfWriter::object_type_NUMBER ? ((PdfWriter::CNumberObject*)pD)->Get() : ((PdfWriter::CRealObject*)pD)->Get();
|
||||
pPageBox = (PdfWriter::CArrayObject*)pPage->Get("MediaBox");
|
||||
pD = pPageBox->Get(3);
|
||||
double dPageY = pD->GetType() == PdfWriter::object_type_NUMBER ? ((PdfWriter::CNumberObject*)pD)->Get() : ((PdfWriter::CRealObject*)pD)->Get();
|
||||
dPageY -= dPageH;
|
||||
oInfo.GetBounds(dX1, dY1, dX2, dY2);
|
||||
pAnnot->SetRect({dPageX + dX1, dPageH - dY1, dPageX + dX2, dPageH - dY2});
|
||||
|
||||
pAnnot->SetPage(pPage, pPage->GetWidth(), dPageH, dPageX);
|
||||
pAnnot->SetPage(pPage, pPage->GetWidth(), dPageH, dPageX, dPageY);
|
||||
pAnnot->SetAnnotFlag(oInfo.GetAnnotFlag());
|
||||
pAnnot->SetDocument(m_pDocument);
|
||||
|
||||
@ -3922,7 +3926,7 @@ PdfWriter::CAnnotAppearanceObject* CPdfWriter::DrawAP(PdfWriter::CAnnotation* pA
|
||||
PdfWriter::CPage* pFakePage = new PdfWriter::CPage(m_pDocument);
|
||||
m_pPage = pFakePage;
|
||||
m_pDocument->SetCurPage(pFakePage);
|
||||
m_pPage->StartTransform(1, 0, 0, 1, -pAnnot->GetPageX(), 0);
|
||||
m_pPage->StartTransform(1, 0, 0, 1, -pAnnot->GetPageX(), pAnnot->GetPageY());
|
||||
|
||||
PdfWriter::CAnnotAppearanceObject* pAP = pAnnot->StartAP(0);
|
||||
|
||||
|
||||
@ -240,12 +240,13 @@ namespace PdfWriter
|
||||
{
|
||||
Add("F", nAnnotFlag);
|
||||
}
|
||||
void CAnnotation::SetPage(CPage* pPage, double dW, double dH, double dX)
|
||||
void CAnnotation::SetPage(CPage* pPage, double dW, double dH, double dX, double dY)
|
||||
{
|
||||
Add("P", pPage);
|
||||
m_dPageWidth = dW;
|
||||
m_dPageW = dW;
|
||||
m_dPageH = dH;
|
||||
m_dPageX = dX;
|
||||
m_dPageY = dY;
|
||||
}
|
||||
void CAnnotation::SetBE(BYTE nType, const double& dBE)
|
||||
{
|
||||
@ -366,9 +367,9 @@ namespace PdfWriter
|
||||
pAnnot->SetAnnotFlag(28);
|
||||
|
||||
TRect oRect = m_oRect;
|
||||
oRect.fLeft = m_dPageWidth - 100 - (oRect.fRight - oRect.fLeft);
|
||||
oRect.fLeft = m_dPageW - 100 - (oRect.fRight - oRect.fLeft);
|
||||
oRect.fBottom -= 100;
|
||||
oRect.fRight = m_dPageWidth;
|
||||
oRect.fRight = m_dPageW;
|
||||
pAnnot->SetRect(oRect);
|
||||
|
||||
return pAnnot;
|
||||
|
||||
@ -160,9 +160,10 @@ namespace PdfWriter
|
||||
|
||||
CXref* m_pXref;
|
||||
TRect m_oRect;
|
||||
double m_dPageWidth = 0;
|
||||
double m_dPageW = 0;
|
||||
double m_dPageH = 0;
|
||||
double m_dPageX = 0;
|
||||
double m_dPageY = 0;
|
||||
CDocument* m_pDocument;
|
||||
CAnnotAppearance* m_pAppearance;
|
||||
|
||||
@ -184,7 +185,7 @@ namespace PdfWriter
|
||||
void SetRect(const TRect& oRect);
|
||||
void SetBorder(BYTE nType, double dWidth, const std::vector<double>& arrDash);
|
||||
void SetAnnotFlag(const int& nAnnotFlag);
|
||||
void SetPage(CPage* pPage, double dW = 0, double dH = 0, double dX = 0);
|
||||
void SetPage(CPage* pPage, double dW = 0, double dH = 0, double dX = 0, double dY = 0);
|
||||
void SetBE(BYTE nType, const double& dBE);
|
||||
void SetContents(const std::wstring& wsText);
|
||||
void SetNM(const std::wstring& wsNM);
|
||||
@ -206,6 +207,7 @@ namespace PdfWriter
|
||||
double GetWidth() { return abs(m_oRect.fRight - m_oRect.fLeft); }
|
||||
double GetHeight() { return abs(m_oRect.fTop - m_oRect.fBottom); }
|
||||
double GetPageX() { return m_dPageX; }
|
||||
double GetPageY() { return m_dPageY; }
|
||||
double GetPageH() { return m_dPageH; }
|
||||
};
|
||||
class CPopupAnnotation : public CAnnotation
|
||||
|
||||
Reference in New Issue
Block a user