from types import *
from . import (
    pdfdoc as pdfdoc,
    pdfgeom as pdfgeom,
    pdfmetrics as pdfmetrics,
    pdfutils as pdfutils,
)
from _typeshed import Incomplete
from math import ceil as ceil

class PDFError(ValueError): ...

FILL_EVEN_ODD: int
FILL_NON_ZERO: int
PATH_OPS: Incomplete
close: str
newpath: str
stroke: str
closeStroke: str
nzFill: str
eoFill: str
fillStroke: str
closeFillStroke: str
eoFillStroke: str
closeEoFillStroke: str

class Canvas:
    _filename: Incomplete
    _doc: Incomplete
    _pagesize: Incomplete
    _currentPageHasImages: int
    _pageTransitionString: str
    _pageCompression: int
    _pageNumber: int
    _code: Incomplete
    bottomup: Incomplete
    _preamble: str
    _x: int
    _y: int
    _fontname: str
    _fontsize: int
    _textMode: int
    _leading: float
    _currentMatrix: Incomplete
    _fillMode: int
    _charSpace: int
    _wordSpace: int
    _horizScale: int
    _textRenderMode: int
    _rise: int
    _textLineMatrix: Incomplete
    _textMatrix: Incomplete
    _lineCap: int
    _lineJoin: int
    _lineDash: Incomplete
    _lineWidth: int
    _mitreLimit: int
    _fillColorRGB: Incomplete
    _strokeColorRGB: Incomplete
    def __init__(self, filename, pagesize=..., bottomup: int = ...) -> None: ...
    def _escape(self, s): ...
    def setAuthor(self, author) -> None: ...
    def setTitle(self, title) -> None: ...
    def setSubject(self, subject) -> None: ...
    def pageHasData(self): ...
    def showPage(self) -> None: ...
    def getPageNumber(self): ...
    def save(
        self, filename: Incomplete | None = ..., fileobj: Incomplete | None = ...
    ) -> None: ...
    def setPageSize(self, size) -> None: ...
    def addLiteral(self, s, escaped: int = ...) -> None: ...
    def transform(self, a, b, c, d, e, f) -> None: ...
    def translate(self, dx, dy) -> None: ...
    def scale(self, x, y) -> None: ...
    def rotate(self, theta) -> None: ...
    def skew(self, alpha, beta) -> None: ...
    def saveState(self) -> None: ...
    def restoreState(self) -> None: ...
    def line(self, x1, y1, x2, y2) -> None: ...
    def lines(self, linelist) -> None: ...
    def grid(self, xlist, ylist) -> None: ...
    def bezier(self, x1, y1, x2, y2, x3, y3, x4, y4) -> None: ...
    def arc(self, x1, y1, x2, y2, startAng: int = ..., extent: int = ...) -> None: ...
    def rect(self, x, y, width, height, stroke: int = ..., fill: int = ...) -> None: ...
    def ellipse(self, x1, y1, x2, y2, stroke: int = ..., fill: int = ...) -> None: ...
    def wedge(
        self, x1, y1, x2, y2, startAng, extent, stroke: int = ..., fill: int = ...
    ) -> None: ...
    def circle(self, x_cen, y_cen, r, stroke: int = ..., fill: int = ...) -> None: ...
    def roundRect(
        self, x, y, width, height, radius, stroke: int = ..., fill: int = ...
    ) -> None: ...
    def drawString(self, x, y, text) -> None: ...
    def drawRightString(self, x, y, text) -> None: ...
    def drawCentredString(self, x, y, text) -> None: ...
    def getAvailableFonts(self): ...
    def setFont(self, psfontname, size, leading: Incomplete | None = ...) -> None: ...
    def stringWidth(self, text, fontname, fontsize): ...
    def setLineWidth(self, width) -> None: ...
    def setLineCap(self, mode) -> None: ...
    def setLineJoin(self, mode) -> None: ...
    _miterLimit: Incomplete
    def setMiterLimit(self, limit) -> None: ...
    def setDash(self, array=..., phase: int = ...) -> None: ...
    def setFillColorRGB(self, r, g, b) -> None: ...
    def setStrokeColorRGB(self, r, g, b) -> None: ...
    def beginPath(self): ...
    def drawPath(self, aPath, stroke: int = ..., fill: int = ...) -> None: ...
    def clipPath(self, aPath, stroke: int = ..., fill: int = ...) -> None: ...
    def beginText(self, x: int = ..., y: int = ...): ...
    def drawText(self, aTextObject) -> None: ...
    def drawInlineImage(
        self,
        image,
        x,
        y,
        width: Incomplete | None = ...,
        height: Incomplete | None = ...,
    ) -> None: ...
    def readJPEGInfo(self, image): ...
    def setPageCompression(self, onoff: int = ...) -> None: ...
    def setPageTransition(
        self,
        effectname: Incomplete | None = ...,
        duration: int = ...,
        direction: int = ...,
        dimension: str = ...,
        motion: str = ...,
    ) -> None: ...

class PDFPathObject:
    _code: Incomplete
    def __init__(self) -> None: ...
    def getCode(self): ...
    def moveTo(self, x, y) -> None: ...
    def lineTo(self, x, y) -> None: ...
    def curveTo(self, x1, y1, x2, y2, x3, y3) -> None: ...
    def arc(self, x1, y1, x2, y2, startAng: int = ..., extent: int = ...) -> None: ...
    def arcTo(self, x1, y1, x2, y2, startAng: int = ..., extent: int = ...) -> None: ...
    def rect(self, x, y, width, height) -> None: ...
    def ellipse(self, x, y, width, height) -> None: ...
    def circle(self, x_cen, y_cen, r) -> None: ...
    def close(self) -> None: ...

class PDFTextObject:
    _code: Incomplete
    _canvas: Incomplete
    _fontname: Incomplete
    _fontsize: Incomplete
    _leading: Incomplete
    def __init__(self, canvas, x: int = ..., y: int = ...) -> None: ...
    def getCode(self): ...
    _x: Incomplete
    _y: Incomplete
    _x0: Incomplete
    def setTextOrigin(self, x, y) -> None: ...
    def setTextTransform(self, a, b, c, d, e, f) -> None: ...
    def moveCursor(self, dx, dy) -> None: ...
    def getCursor(self): ...
    def getX(self): ...
    def getY(self): ...
    def setFont(self, psfontname, size, leading: Incomplete | None = ...) -> None: ...
    _charSpace: Incomplete
    def setCharSpace(self, charSpace) -> None: ...
    _wordSpace: Incomplete
    def setWordSpace(self, wordSpace) -> None: ...
    _horizScale: Incomplete
    def setHorizScale(self, horizScale) -> None: ...
    def setLeading(self, leading) -> None: ...
    _textRenderMode: Incomplete
    def setTextRenderMode(self, mode) -> None: ...
    _rise: Incomplete
    def setRise(self, rise) -> None: ...
    _strokeColorRGB: Incomplete
    def setStrokeColorRGB(self, r, g, b) -> None: ...
    _fillColorRGB: Incomplete
    def setFillColorRGB(self, r, g, b) -> None: ...
    def textOut(self, text) -> None: ...
    def textLine(self, text: str = ...) -> None: ...
    def textLines(self, stuff, trim: int = ...) -> None: ...
